max_stars_repo_path
stringlengths
4
237
max_stars_repo_name
stringlengths
6
117
max_stars_count
int64
0
95.2k
id
stringlengths
1
7
content
stringlengths
12
593k
input_ids
listlengths
7
549k
office365/sharepoint/portal/group_site_manager.py
rikeshtailor/Office365-REST-Python-Client
0
9312
<reponame>rikeshtailor/Office365-REST-Python-Client from office365.runtime.client_object import ClientObject from office365.runtime.client_result import ClientResult from office365.runtime.http.http_method import HttpMethod from office365.runtime.queries.service_operation_query import ServiceOperationQuery from office3...
[ 1, 529, 276, 1112, 420, 29958, 5357, 267, 400, 737, 272, 29914, 27247, 29941, 29953, 29945, 29899, 1525, 1254, 29899, 11980, 29899, 4032, 13, 3166, 8034, 29941, 29953, 29945, 29889, 15634, 29889, 4645, 29918, 3318, 1053, 12477, 2061, 13, ...
python/cracking_codes_with_python/k_columnar_transposition_cipher_hack.py
MerrybyPractice/book-challanges-and-tutorials
0
48975
# Columnar Transposition Hack per Cracking Codes with Python # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import pyperclip from j_detect_english import is_english from g_decrypt_columnar_transposition_cipher import decrypt_message as decrypt def hack_transposition(text): print('Press Ctrl-C to quit a...
[ 1, 396, 12481, 279, 4103, 3283, 379, 547, 639, 14279, 384, 292, 315, 2631, 411, 5132, 13, 29937, 2045, 597, 1636, 29889, 6582, 1279, 29889, 510, 29914, 29883, 22282, 292, 18137, 29914, 313, 29933, 7230, 10413, 21144, 29897, 13, 13, 5215...
btree.py
chrisconley/python-data-structures
0
1607164
from collections import deque class BinarySearchTree: def __init__(self): self.root = None def get(self, key): return self._get(self.root, key) def _get(self, node, key): if node is None: return None if key < node.key: return self._get(node.left, k...
[ 1, 515, 16250, 1053, 316, 802, 13, 13, 13, 1990, 29479, 7974, 9643, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 4632, 353, 6213, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 1820, 1125, 13, 4706, 736, ...
pastebin/migrations/0006_auto_20170129_1502.py
johannessarpola/django-pastebin
0
47244
<reponame>johannessarpola/django-pastebin<filename>pastebin/migrations/0006_auto_20170129_1502.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11a1 on 2017-01-29 15:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependenci...
[ 1, 529, 276, 1112, 420, 29958, 29926, 1148, 812, 404, 6834, 2963, 29914, 14095, 29899, 16179, 2109, 29966, 9507, 29958, 16179, 2109, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29953, 29918, 6921, 29918, 29906, 29900, 29896, 29955, 29900, ...
3_2_HelloWorld.py
Asurada2015/TensorFlowactual-combat_code
4
159118
<reponame>Asurada2015/TensorFlowactual-combat_code #%% # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
[ 1, 529, 276, 1112, 420, 29958, 2887, 332, 1114, 29906, 29900, 29896, 29945, 29914, 29911, 6073, 17907, 19304, 29899, 510, 10222, 29918, 401, 13, 29937, 7686, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29945, 450, 323, 6073, 17907, ...
DQN DDQN Dueling/network.py
eayvali/DeepRL
2
21356
# -*- coding: utf-8 -*- """ Created on Sun Jan 19 23:19:43 2020 @author: elif.ayvali """ import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict class deep_Q_net(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, seed): ...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 20399, 373, 8991, 2627, 29871, 29896, 29929, 29871, 29906, 29941, 29901, 29896, 29929, 29901, 29946, 29941, 29871, 29906, 29900, 29906, 299...
javascript/forms.py
uadson/studies
0
99561
<reponame>uadson/studies<gh_stars>0 from django import forms class CalcImcForm(forms.Form): peso = forms.CharField( required=False) altura = forms.CharField( required=False)
[ 1, 529, 276, 1112, 420, 29958, 29884, 328, 1100, 29914, 18082, 583, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 1053, 7190, 13, 13, 1990, 3037, 29883, 1888, 29883, 2500, 29898, 9514, 29889, 2500, 1125, 13, 1678, 8928, ...
src/bot/handlers/essence_part_handler.py
nchursin/claimant
3
34211
from typing import Optional, List from aiogram import types, Dispatcher, filters from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters.state import StatesGroup, State from aiogram.types import ReplyKeyboardMarkup from handlers.common_actions_handlers import process_manual_enter, process_option_sel...
[ 1, 515, 19229, 1053, 28379, 29892, 2391, 13, 13, 3166, 7468, 13342, 1053, 4072, 29892, 3295, 5041, 261, 29892, 18094, 13, 3166, 7468, 13342, 29889, 13369, 261, 1053, 383, 17061, 2677, 13, 3166, 7468, 13342, 29889, 13369, 261, 29889, 26705...
piccel/ui/__init__.py
lesca-research/piccel
2
188313
from .generated import access_ui from .generated import data_sheet_ui from .generated import form_item_ui from .generated import form_ui from .generated import item_boolean_checkboxes_ui from .generated import item_choice_radio_ui from .generated import item_datetime_ui from .generated import item_single_line_ui from ....
[ 1, 515, 869, 13525, 1053, 2130, 29918, 1481, 13, 3166, 869, 13525, 1053, 848, 29918, 9855, 29918, 1481, 13, 3166, 869, 13525, 1053, 883, 29918, 667, 29918, 1481, 13, 3166, 869, 13525, 1053, 883, 29918, 1481, 13, 3166, 869, 13525, 1053, ...
locan/data/hulls/__init__.py
super-resolution/Locan
8
9558
<filename>locan/data/hulls/__init__.py """ Hull objects of localization data. Submodules: ----------- .. autosummary:: :toctree: ./ hull alpha_shape """ from locan.data.hulls.alpha_shape import * from locan.data.hulls.hull import * __all__ = [] __all__.extend(hull.__all__) __all__.extend(alpha_shape.__al...
[ 1, 529, 9507, 29958, 2029, 273, 29914, 1272, 29914, 29882, 913, 29879, 29914, 1649, 2344, 26914, 2272, 13, 15945, 29908, 13, 29950, 913, 3618, 310, 1887, 2133, 848, 29889, 13, 13, 4035, 7576, 29901, 13, 1378, 5634, 13, 13, 636, 1120, ...
09-PiDay2022/IBM_quantum_randomness.py
StrangeGirlMurph/CodingProjects
0
175546
from qiskit import * from qiskit import IBMQ from qiskit.tools.monitor import job_monitor from qiskit.providers.ibmq import least_busy def random_qubit(): IBMQ.load_account() provider = IBMQ.get_provider("ibm-q") small_devices = provider.backends( filters=lambda x: x.configuration().n_qubits == 5...
[ 1, 515, 3855, 3873, 277, 1053, 334, 13, 3166, 3855, 3873, 277, 1053, 15731, 25566, 13, 3166, 3855, 3873, 277, 29889, 8504, 29889, 3712, 2105, 1053, 4982, 29918, 3712, 2105, 13, 3166, 3855, 3873, 277, 29889, 771, 29454, 29889, 747, 28466...
moredata/enricher/elasticsearch_connector/__init__.py
thomassonobe/more-data
0
57654
from .elasticsearch_connector import * from .index_handler import * from .policy_handler import *
[ 1, 515, 869, 295, 20291, 29918, 11958, 2801, 1053, 334, 13, 3166, 869, 2248, 29918, 13789, 1053, 334, 13, 3166, 869, 22197, 29918, 13789, 1053, 334, 13, 2 ]
scripts/03_glove_build_counts.py
svlandeg/sense2vec
1,140
124120
<reponame>svlandeg/sense2vec<gh_stars>1000+ #!/usr/bin/env python import os from pathlib import Path from wasabi import msg import typer def main( # fmt: off glove_dir: str = typer.Argument(..., help="Directory containing the GloVe build"), in_dir: str = typer.Argument(..., help="Directory with preprocess...
[ 1, 529, 276, 1112, 420, 29958, 4501, 28328, 29887, 29914, 29879, 1947, 29906, 2003, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29900, 29974, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 2897, 13, 3166, ...
Lib/vanilla/vanillaGradientButton.py
miguelsousa/vanilla
21
97761
from AppKit import * from vanillaButton import ImageButton class GradientButton(ImageButton): nsBezelStyle = NSSmallSquareBezelStyle
[ 1, 515, 2401, 13117, 1053, 334, 13, 3166, 1109, 2911, 3125, 1053, 7084, 3125, 13, 13, 13, 1990, 19295, 993, 3125, 29898, 2940, 3125, 1125, 13, 13, 1678, 17534, 3629, 10533, 5568, 353, 405, 1799, 29885, 497, 29903, 4718, 3629, 10533, 5...
ui_test/user_flows.py
uktrade/dit-contact-forms
2
156652
from ui_test.selectors.questionnaire import QUESTIONNAIRE from ui_test.selectors.form import FORM def select_questionnaire(browser, options): for key, value in options.items(): browser.find_by_css(QUESTIONNAIRE[key][value]).click() browser.find_by_css(QUESTIONNAIRE["continue"]).click() def submi...
[ 1, 515, 14313, 29918, 1688, 29889, 2622, 943, 29889, 12470, 15421, 1053, 660, 4462, 1254, 2725, 3521, 29902, 1525, 13, 3166, 14313, 29918, 1688, 29889, 2622, 943, 29889, 689, 1053, 383, 12054, 13, 13, 13, 1753, 1831, 29918, 12470, 15421, ...
pybomberman/__init__.py
pybomberman/pybomberman
2
32978
from .map import Map print("Soon... https://github.com/pybomberman/pybomberman")
[ 1, 515, 869, 1958, 1053, 7315, 13, 13, 2158, 703, 29903, 6150, 856, 2045, 597, 3292, 29889, 510, 29914, 2272, 29890, 290, 495, 1171, 29914, 2272, 29890, 290, 495, 1171, 1159, 13, 2 ]
base_python/tests/test_flatten.py
cogment/cogment-verse
23
106746
<reponame>cogment/cogment-verse # Copyright 2021 AI Redefined Inc. <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
[ 1, 529, 276, 1112, 420, 29958, 29883, 468, 358, 29914, 29883, 468, 358, 29899, 3901, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 319, 29902, 4367, 5598, 9266, 29889, 3532, 26862, 6227, 6778, 13, 29937, 13, 29937, 10413, 211...
cbh.py
jensengroup/fragreact
2
33656
<reponame>jensengroup/fragreact<gh_stars>1-10 #!/usr/bin/env python import numpy as np import re from rdkit import Chem from rdkit.Chem import rdMolDescriptors from itertools import combinations import copy def print_smiles(smiles_list, human=False): smiles_dict = count_smiles(smiles_list) keys = smiles_dic...
[ 1, 529, 276, 1112, 420, 29958, 29926, 14762, 2972, 29914, 29888, 1431, 8423, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 12655, 408, 7442, 13, 52...
mlcomp/parallelm/pipeline/component_dir_helper.py
lisapm/mlpiper
7
198337
<filename>mlcomp/parallelm/pipeline/component_dir_helper.py<gh_stars>1-10 import pkg_resources import logging import os from parallelm.common.base import Base class ComponentDirHelper(Base): def __init__(self, pkg, main_program): """ Extract component directory outside of egg, so an external com...
[ 1, 529, 9507, 29958, 828, 2388, 29914, 23482, 29885, 29914, 13096, 5570, 29914, 9700, 29918, 3972, 29918, 20907, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 282, 9415, 29918, 13237, 13, 5215, 12...
test.py
nerdingitout/STT--
0
28057
<gh_stars>0 import pandas as pd import json import csv # importing the module import json # Opening JSON file with open('response.json') as json_file: data = json.load(json_file) # for reading nested data [0] represents # the index value of the list print(data['results'][0]['alternatives...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 11701, 408, 10518, 13, 5215, 4390, 13, 5215, 11799, 13, 13, 13, 13, 29937, 28348, 278, 3883, 29871, 13, 5215, 4390, 29871, 13, 259, 13, 29937, 4673, 292, 4663, 934, 29871, 13, ...
vulnerable_people_form/integrations/google_analytics.py
uk-gov-mirror/alphagov.govuk-shielded-vulnerable-people-service
3
125960
import requests import sentry_sdk from flask import current_app def track_event(category, action, label=None, value=0): data = { "v": "1", # API Version. "tid": current_app.config["GA_TRACKING_ID"], # Tracking ID / Property ID. # Anonymous Client Identifier. Ideally, this should be a UUI...
[ 1, 1053, 7274, 13, 5215, 2665, 719, 29918, 15348, 13, 3166, 29784, 1053, 1857, 29918, 932, 13, 13, 13, 1753, 5702, 29918, 3696, 29898, 7320, 29892, 3158, 29892, 3858, 29922, 8516, 29892, 995, 29922, 29900, 1125, 13, 1678, 848, 353, 426,...
assignment3/code/q4.1.py
liusida/ds2
0
121156
# requirements.txt: # pyro 1.6.0 # torch 1.8.0 import pyro from pyro.distributions import Normal,Gamma,InverseGamma,Bernoulli,Poisson import matplotlib.pyplot as plt # import pyro.poutine as poutine pyro.set_rng_seed(101) def normal_density_estimation(obs, N): assert obs is None or N==obs.shape[0] loc = pyro....
[ 1, 396, 11780, 29889, 3945, 29901, 13, 29937, 11451, 307, 29871, 29896, 29889, 29953, 29889, 29900, 13, 29937, 4842, 305, 29871, 29896, 29889, 29947, 29889, 29900, 13, 13, 5215, 11451, 307, 13, 3166, 11451, 307, 29889, 27691, 29879, 1053, ...
openrave/docs/source/tutorials/openravepy_examples/simple_environment_loading.py
jdsika/TUM_HOly
2
88903
<gh_stars>1-10 """Loads up an environment, attaches a viewer, loads a scene, and requests information about the robot. """ from openravepy import * env = Environment() # create openrave environment env.SetViewer('qtcoin') # attach viewer (optional) env.Load('data/lab1.env.xml') # load a simple scene robot = env.GetRobo...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 5896, 29879, 701, 385, 5177, 29892, 10641, 267, 263, 6316, 556, 29892, 15376, 263, 9088, 29892, 322, 7274, 2472, 1048, 278, 19964, 29889, 13, 15945, 299...
TestMatrices.py
Tsyrema/Computing-the-Distance-Matrix-and-the-Covariance-Matrix-of-Data
0
108405
# script to test your computation code # do not change this file from ComputeMatrices import compute_distance_naive, \ compute_distance_smart, compute_correlation_naive, \ compute_correlation_smart import numpy as np from sklearn.datasets import load_iris # my computation def my_comp_distance(X): N = X.sh...
[ 1, 396, 2471, 304, 1243, 596, 16287, 775, 13, 29937, 437, 451, 1735, 445, 934, 13, 13, 3166, 11796, 29872, 29924, 8141, 1575, 1053, 10272, 29918, 19244, 29918, 1056, 573, 29892, 320, 13, 1678, 10272, 29918, 19244, 29918, 3844, 442, 2989...
sailfish/solvers/scdg_1d.py
Javk5pakfa/sailfish
1
94987
<reponame>Javk5pakfa/sailfish """ An n-th order discontinuous Galerkin solver for 1D scalar advection. """ from typing import NamedTuple from numpy.polynomial.legendre import leggauss, Legendre from sailfish.mesh import PlanarCartesianMesh from sailfish.solver import SolverBase class CellData: """ Gauss weig...
[ 1, 529, 276, 1112, 420, 29958, 29967, 485, 29895, 29945, 29886, 557, 5444, 29914, 29879, 737, 15161, 13, 15945, 29908, 13, 2744, 302, 29899, 386, 1797, 766, 20621, 681, 5208, 5968, 262, 899, 369, 363, 29871, 29896, 29928, 17336, 594, 34...
pychron/lasers/power/composite_calibration_manager.py
ASUPychron/pychron
31
2675
<reponame>ASUPychron/pychron # =============================================================================== # Copyright 2012 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
[ 1, 529, 276, 1112, 420, 29958, 3289, 4897, 3376, 1617, 29914, 2272, 5904, 13, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 2751, 29922, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29906, 529, 5813, 29958, 13, 29937, 13, 29937, 10413...
library/modulemanager.py
l29ah/vk4xmpp
77
94195
<reponame>l29ah/vk4xmpp # coding: utf-8 # This file is a part of VK4XMPP transport # © simpleApps, 2015. """ Manages python modules as xmpppy handlers """ __author__ = "mrDoctorWho <<EMAIL>>" __version__ = "1.1" import os from writer import * from __main__ import Component, TransportFeatures, UserFeatures def prox...
[ 1, 529, 276, 1112, 420, 29958, 29880, 29906, 29929, 801, 29914, 29894, 29895, 29946, 29916, 29885, 407, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 29937, 910, 934, 338, 263, 760, 310, 478, 29968, 29946, 29990, 3580, 29925, 8608, 13...
appengine-compat/exported_appengine_sdk/google/storage/speckle/proto/jdbc_type.py
speedplane/python-compat-runtime
26
6849
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29900, 29955, 5087, 9266, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, ...
vertexLite/views.py
FelixTheC/onlineOrderForm
0
182004
<reponame>FelixTheC/onlineOrderForm from django.forms import formset_factory from django.shortcuts import redirect from django.urls import reverse from django.views.generic import UpdateView from extras.views import PDFView from extras.views import ThanksForOderView from orderForm.own_decorator import hash_is_allowed f...
[ 1, 529, 276, 1112, 420, 29958, 29943, 295, 861, 1576, 29907, 29914, 14627, 7514, 2500, 13, 3166, 9557, 29889, 9514, 1053, 883, 842, 29918, 14399, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 6684, 13, 3166, 9557, 29889, 26045, 1053, ...
DFS/BinaryTreeMaxPathSum.py
karan2808/Python-Data-Structures-and-Algorithms
2
53631
class Solution: def __init__(self): self.result = None def findMax(self, root): if root == None: return 0 # find max for left and right node left = self.findMax(root.left) right = self.findMax(root.right) # can either go straight down i.e. from root...
[ 1, 770, 24380, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 2914, 353, 6213, 13, 13, 1678, 822, 1284, 7976, 29898, 1311, 29892, 3876, 1125, 13, 4706, 565, 3876, 1275, 6213, 29901, 13, 9651, 736, 29871, 2...
Processing.py
Ruframapi/reconoSERTest
0
145596
<filename>Processing.py """ File Processing without Spark. Just to take a look. """ import sys import os import json import re import random import nltk import datetime from nltk.tokenize import TweetTokenizer from nltk.corpus import stopwords from nltk.util import skipgrams def main(): filepath = sys.argv...
[ 1, 529, 9507, 29958, 7032, 292, 29889, 2272, 13, 15945, 29908, 13, 2283, 10554, 292, 1728, 20814, 29889, 3387, 304, 2125, 263, 1106, 29889, 13, 13, 15945, 29908, 13, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 4390, 13, 5215, 337, 13, ...
twenty47/__init__.py
gary-dalton/Twenty47
0
77220
<reponame>gary-dalton/Twenty47 from flask import Flask, flash from flask.ext.mongoengine import MongoEngine from flask_wtf.csrf import CsrfProtect from flask_mail import Mail import blinker app = Flask(__name__) #app.config.from_object(__name__) # Load the config app.config.from_pyfile('local.config.py') #app.config....
[ 1, 529, 276, 1112, 420, 29958, 29887, 653, 29899, 12293, 880, 29914, 27418, 6478, 29946, 29955, 13, 3166, 29784, 1053, 2379, 1278, 29892, 11013, 13, 3166, 29784, 29889, 1062, 29889, 29885, 7443, 10599, 1053, 18294, 12412, 13, 3166, 29784, ...
similarityworkbench/bin/mcs/Cmcs.py
gitanna/chemminetools
2
98957
#!/usr/bin/python # -*- coding: utf-8 -*- # This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. # This file is compatible with both classic and new-style classes. import _Cmcs import new new_instancemethod = new.instancem...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 29937, 910, 934, 471, 6336, 5759, 491, 25289, 6259, 313, 1124, 597, 1636, 29889, 2774, 335, 29889, 990, ...
alpa/timer.py
TarzanZhao/alpa
0
1609155
"""Global timer for profiling.""" import time from typing import Callable do_sync = True class _Timer: """An internal timer.""" def __init__(self, name: str): self.name = name self.started = False self.start_time = None self.costs = [] # Loop timer self.ever_...
[ 1, 9995, 12756, 12237, 363, 20077, 292, 1213, 15945, 13, 5215, 931, 13, 3166, 19229, 1053, 8251, 519, 13, 13, 1867, 29918, 16593, 353, 5852, 13, 13, 13, 1990, 903, 14745, 29901, 13, 1678, 9995, 2744, 7463, 12237, 1213, 15945, 13, 13, ...
AcimdesTrainingServer.py
IvanDerdicDer/Acimdes
0
97326
import random from typing import List import NeuralNetwork as nn import os import multiprocessing as mp import threading as thrd import pickle import time class Cards: def __init__(self): self.cards = [] for _ in range(4): temp = random.sample(range(8), 8) for ...
[ 1, 1053, 4036, 30004, 13, 3166, 19229, 1053, 2391, 30004, 13, 5215, 2448, 3631, 13724, 408, 302, 29876, 30004, 13, 5215, 2897, 30004, 13, 5215, 6674, 307, 985, 292, 408, 22326, 30004, 13, 5215, 3244, 292, 408, 1468, 29881, 30004, 13, ...
solutions/807/807-kir3i.py
iknoom/LeetCode-Solutions
4
101366
<reponame>iknoom/LeetCode-Solutions<filename>solutions/807/807-kir3i.py class Solution: def maxIncreaseKeepingSkyline(self, grid): skyline = [] for v_line in grid: skyline.append([max(v_line)] * len(grid)) for x, h_line in enumerate(list(zip(*grid))): max_h = max(h_...
[ 1, 529, 276, 1112, 420, 29958, 638, 1217, 290, 29914, 3226, 300, 3399, 29899, 13296, 17925, 29966, 9507, 29958, 2929, 17925, 29914, 29947, 29900, 29955, 29914, 29947, 29900, 29955, 29899, 14166, 29941, 29875, 29889, 2272, 13, 1990, 24380, 2...
cds_migrator_kit/circulation/__init__.py
kprzerwa/cds-migrator-kit
0
81310
<reponame>kprzerwa/cds-migrator-kit # -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # cds-migrator-kit is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """CDS Migrator Circulation module.""" ...
[ 1, 529, 276, 1112, 420, 29958, 29895, 558, 3298, 2766, 29914, 2252, 29879, 29899, 26983, 1061, 29899, 7354, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 910, 934, 338, 760, 310,...
onadata/apps/logger/management/commands/set_xform_surveys_with_geopoints.py
childhelpline/myhelpline
1
135766
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 fileencoding=utf-8 from django.core.management.base import BaseCommand from django.utils.translation import ugettext_lazy from onadata.apps.logger.models.xform import XForm from onadata.libs.utils.model_tools import queryset_iterator class Command(BaseCommand): ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 325, 326, 29901, 7468, 18696, 29922, 29946, 380, 29879, 29922, 29946, 634, 2381, 29922, 29946, 934, 22331, 29922, 9420, 29899, 29947, 13, 13, 3166, 9557, 29889, 3221, 29889, 21895, ...
bookings/views.py
nintran1995/python-example
0
180096
from django.shortcuts import render from django.http import HttpResponse from django.template import loader from .models import Boarding from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic class IndexView(generic.ListView): model = Boarding template_na...
[ 1, 515, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 13, 3166, 9557, 29889, 6886, 1053, 23466, 13, 3166, 869, 9794, 1053, 12590, 292, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 24735, 1...
trialbot/data/datasets/tabular_dataset.py
zxteloiv/TrialBot
3
1616063
from .file_dataset import FileDataset class TabSepFileDataset(FileDataset): def get_example(self, i): line = super(TabSepFileDataset, self).get_example(i) parts = line.rstrip('\r\n').split('\t') return tuple(parts)
[ 1, 515, 869, 1445, 29918, 24713, 1053, 3497, 16390, 24541, 13, 13, 1990, 11090, 29903, 1022, 2283, 16390, 24541, 29898, 2283, 16390, 24541, 1125, 13, 1678, 822, 679, 29918, 4773, 29898, 1311, 29892, 474, 1125, 13, 4706, 1196, 353, 2428, ...
custom_components/tastyigniter/binary_sensor.py
djtimca/hatastyigniter
0
111306
"""Definition and setup of the TastyIgniter Binary Sensors for Home Assistant.""" import logging import time from homeassistant.helpers.update_coordinator import ( CoordinatorEntity, DataUpdateCoordinator, UpdateFailed, ) from homeassistant.components.binary_sensor import BinarySensorEntity from homeassis...
[ 1, 9995, 14683, 322, 6230, 310, 278, 323, 579, 29891, 17273, 1524, 29479, 317, 575, 943, 363, 8778, 4007, 22137, 1213, 15945, 13, 13, 5215, 12183, 13, 5215, 931, 13, 13, 3166, 3271, 465, 22137, 29889, 3952, 6774, 29889, 5504, 29918, 1...
poetry/console/commands/self/update.py
mgasner/poetry
0
7786
<reponame>mgasner/poetry<gh_stars>0 import hashlib import os import shutil import subprocess import sys import tarfile from functools import cmp_to_key from gzip import GzipFile try: from urllib.error import HTTPError from urllib.request import urlopen except ImportError: from urllib2 import HTTPError ...
[ 1, 529, 276, 1112, 420, 29958, 29885, 25496, 1089, 29914, 1129, 27184, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 6608, 1982, 13, 5215, 2897, 13, 5215, 528, 4422, 13, 5215, 1014, 5014, 13, 5215, 10876, 13, 5215, 9913, 1445,...
Backend/models/risklayerPrognosis.py
dbvis-ukon/coronavis
15
6542
from db import db class RisklayerPrognosis(db.Model): __tablename__ = 'risklayer_prognosis' datenbestand = db.Column(db.TIMESTAMP, primary_key=True, nullable=False) prognosis = db.Column(db.Float, nullable=False) # class RisklayerPrognosisSchema(SQLAlchemyAutoSchema): # class Meta: # strict ...
[ 1, 515, 4833, 1053, 4833, 13, 13, 13, 1990, 390, 3873, 13148, 1184, 5138, 19263, 29898, 2585, 29889, 3195, 1125, 13, 1678, 4770, 3891, 2435, 420, 1649, 353, 525, 3780, 6321, 2747, 29918, 771, 5138, 19263, 29915, 13, 13, 1678, 1418, 26...
falkon/kernels/distance_kernel.py
vishalbelsare/falkon
130
91717
from typing import Union, Optional, Dict import torch from falkon import sparse from falkon.kernels.diff_kernel import DiffKernel from falkon.la_helpers.square_norm_fn import square_norm_diff from falkon.options import FalkonOptions from falkon.sparse import SparseTensor SQRT3 = 1.7320508075688772 SQRT5 = 2.23606797...
[ 1, 515, 19229, 1053, 7761, 29892, 28379, 29892, 360, 919, 13, 13, 5215, 4842, 305, 13, 13, 3166, 285, 2235, 265, 1053, 29234, 13, 3166, 285, 2235, 265, 29889, 22178, 1379, 29889, 12765, 29918, 17460, 1053, 360, 2593, 29968, 5851, 13, ...
scripts/graph.py
maurizioabba/rose
488
56323
#!/usr/bin/env python # ############################################################################### # # Author: <NAME> # Date: 8/24/2006 # File: graph.py # Purpose: Plots ROSE performance data # ############################################################################### import sys import os import string impo...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 13, 13383, 13383, 13383, 13383, 7346, 4136, 2277, 29937, 13, 29937, 13, 29937, 13361, 29901, 529, 5813, 29958, 13, 29937, 4712, 29901, 29871, 29947, 29914, 29906, 29946, 29914, 2990...
scripts/migrate_to_rapidpro/fix_auto_baby_switch_data.py
praekeltfoundation/ndoh-hub
0
176707
import asyncio import csv import os import time from datetime import datetime, timedelta import aiohttp import psycopg2 from six.moves import urllib_parse CONCURRENCY = 10 HUB_OUTPUT_FILE = "hub_babyswitches.csv" RAPIDPRO_OUTPUT_FILE = "rapidpro_babyswitch_updates.csv" LIMIT = 10_000_000 RAPIDPRO_URL = "https://rapi...
[ 1, 1053, 408, 948, 3934, 13, 5215, 11799, 13, 5215, 2897, 13, 5215, 931, 13, 3166, 12865, 1053, 12865, 29892, 5335, 287, 2554, 13, 13, 5215, 263, 601, 1124, 13, 5215, 6529, 29891, 9708, 29887, 29906, 13, 3166, 4832, 29889, 13529, 267,...
packer/python/packerTest1.py
RalphBrynard/sophos_attack_range
0
175864
from packerlicious import builder, provisioner, Template template = Template() template.add_builder( builder.vmware-iso( ) ) { "description": "Packer Windows Server 2016 build template file.", "_comment": "Template file provides framework for subsequent packer builds.", "variables": { "os-iso-pa...
[ 1, 515, 4870, 261, 506, 2738, 1053, 12856, 29892, 25161, 261, 29892, 25663, 13, 6886, 353, 25663, 580, 13, 6886, 29889, 1202, 29918, 16409, 29898, 13, 1678, 12856, 29889, 6925, 2519, 29899, 10718, 29898, 13, 308, 13, 1678, 1723, 13, 298...
.travis/tests.py
frogunder/salt-winrepo-ng
0
184897
<gh_stars>0 #!/usr/bin/env python2.7 # -*- coding: utf-8 -*- import getopt import git import pycurl as curl import sys import traceback import yaml, glob, os from jinja2 import Template from pprint import pprint from StringIO import StringIO from urlparse import urlparse reload(sys) sys.setdefaultencoding('utf8') te...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29906, 29889, 29955, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 679, 3670, 13, 5...
tools/pca_outcore.py
escorciav/deep-action-proposals
28
16618
<filename>tools/pca_outcore.py #!/usr/bin/env python """ PCA done via matrix multiplication out-of-core. """ import argparse import time import h5py import hickle as hkl import numpy as np def input_parse(): description = 'Compute PCA with A.T * A computation out of core' p = argparse.ArgumentParser(descri...
[ 1, 529, 9507, 29958, 8504, 29914, 29886, 1113, 29918, 449, 3221, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 13, 13, 29925, 5454, 2309, 3025, 4636, 21666, 714, 29899, 974, 29899, 3221, 29889, 13,...
src/response.py
technomunk/bottica
2
179123
# Response messages. import random from discord.ext import commands SUCCESSES = ( "Success", "Done", ":100:", ":ok:", ":smile::+1:", ) FAILS = ( "Fail", "Bump", "Poop", ":poop:", ":frowning::-1:", ) JEALOUS = ( "Who's this?", "Who is that?", "What are they doing ...
[ 1, 396, 13291, 7191, 29889, 13, 13, 5215, 4036, 13, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 13, 13, 14605, 4174, 2890, 1660, 29903, 353, 313, 13, 1678, 376, 14191, 613, 13, 1678, 376, 25632, 613, 13, 1678, 29242, 29896, 29900, ...
test/test.py
bciar/ppp-web
2
1696
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Unit tests.""" import os import unittest from copy import copy from webui.app import create_app class TestRoutes(unittest.TestCase): """Test routes.""" ignore_routes = ('/static/<path:filename>',) ignore_end_patterns = ('>',) def setUp(self): ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 8325, 6987, 1213, 15945, 13, 5215, 2897, 13, 5215, 443, 27958, 13, 3166, 3509, 10...
dcgan/utils/train.py
Ontheway361/ak47GAN
0
30840
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time import torch import numpy as np import torchvision import torch.nn as nn import torch.optim as optim import matplotlib.pyplot as plt from torch.utils.data import DataLoader from utils import * from IPython import embed class DCGAN(o...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 931, 13, 5215, 4842, 305, 13, 5215, 12655, 408, 74...
projects/migrations/0003_projectport_container_port.py
kilinger/marathon-rocketchat-hubot
1
184119
<reponame>kilinger/marathon-rocketchat-hubot # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('projects', '0002_auto_20160122_0305'), ] operations = [ migrations.AddField( ...
[ 1, 529, 276, 1112, 420, 29958, 16757, 5621, 29914, 3034, 25206, 29899, 20821, 3486, 271, 29899, 29882, 431, 327, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, ...
test.py
sbcshop/PiRelay-8
2
4654
<reponame>sbcshop/PiRelay-8<filename>test.py<gh_stars>1-10 from PiRelay8 import Relay import time r1 = Relay("RELAY1") r2 = Relay("RELAY2") r3 = Relay("RELAY3") r4 = Relay("RELAY4") r5 = Relay("RELAY5") r6 = Relay("RELAY6") r7 = Relay("RELAY7") r8 = Relay("RELAY8") r1.off() r2.off() r3.off() r4.off()...
[ 1, 529, 276, 1112, 420, 29958, 29879, 12328, 19032, 29914, 12197, 9662, 388, 29899, 29947, 29966, 9507, 29958, 1688, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 7362, 9662, 388, 29947, 1053, 637...
src/median_of_medians.py
SynerClust/SynerClust
7
70112
<reponame>SynerClust/SynerClust import math import numpy def pivot(l, left, right): # right should be len(l)-1 """ Returns the position of the median of medians. Left and right values should be the start and end positions of the part of the array to use. """ if (right - left < 5): return partition5(l, left, ri...
[ 1, 529, 276, 1112, 420, 29958, 29216, 261, 6821, 504, 29914, 29216, 261, 6821, 504, 13, 5215, 5844, 13, 5215, 12655, 13, 13, 1753, 24438, 29898, 29880, 29892, 2175, 29892, 1492, 1125, 29871, 396, 1492, 881, 367, 7431, 29898, 29880, 6817...
soluciones/df_concatenar.py
carlosviveros/Soluciones
1
120260
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython TODO: add docstring and tests. """ import pandas as pd from prototools import retrieve_argname, tabulate, red HEADERS = ["Source", "A", "B", "C"] source_1 = pd.DataFrame( { "A": [1, 2, 3], "B": [4, 5, 6], "C": [7, 8, 9] } )...
[ 1, 9995, 29909, 29891, 6191, 2369, 11980, 29901, 2045, 597, 1636, 29889, 15445, 29889, 510, 29914, 13155, 29914, 388, 566, 481, 1656, 13, 13, 4986, 3970, 29901, 788, 1574, 1807, 322, 6987, 29889, 13, 15945, 29908, 13, 5215, 11701, 408, ...
squares.py
SrujanAakurathi/Programming-Assignments
0
77537
""" Given an integer number n, define a function named printDict() which can print a dictionary where the keys are numbers between 1 and n (both included) and the values are square of keys. The function printDict() doesn't take any argument. Input Format: The first line contains the number n. Output Format: Print t...
[ 1, 9995, 13, 13, 11221, 385, 6043, 1353, 302, 29892, 4529, 263, 740, 4257, 1596, 21533, 580, 607, 508, 1596, 263, 8600, 988, 278, 6611, 526, 3694, 1546, 29871, 29896, 322, 302, 313, 20313, 5134, 29897, 322, 278, 1819, 526, 6862, 310, ...
src/triage/component/postmodeling/contrast/utils/aux_funcs.py
silvrwolfboy/triage-1
0
1614161
<reponame>silvrwolfboy/triage-1<filename>src/triage/component/postmodeling/contrast/utils/aux_funcs.py ''' A4uxiliary functions and helpers: This set of functions are helper functions to format data (i.e., prediction matrices, etc.) for plotting. This functions are called in both Model class and ModelGroup class in ...
[ 1, 529, 276, 1112, 420, 29958, 25590, 13416, 29893, 4369, 19415, 29914, 3626, 482, 29899, 29896, 29966, 9507, 29958, 4351, 29914, 3626, 482, 29914, 9700, 29914, 2490, 4299, 292, 29914, 9996, 579, 29914, 13239, 29914, 2993, 29918, 7692, 2395...
scripts/create_targets.py
pjsier/horoscope-markov
0
66936
import sys from datetime import date, timedelta SIGN_IDS = list(range(1, 13)) if __name__ == "__main__": start_date = date(2019, 1, 1) end_date = date.today() for date_diff in range(0, (end_date - start_date).days + 1): date_str = (start_date + timedelta(days=date_diff)).strftime("%Y%m%d") ...
[ 1, 1053, 10876, 13, 3166, 12865, 1053, 2635, 29892, 5335, 287, 2554, 13, 13, 5425, 20728, 29918, 1367, 29903, 353, 1051, 29898, 3881, 29898, 29896, 29892, 29871, 29896, 29941, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396...
lib/python2.7/site-packages/braintree/coinbase_account.py
ervinpepic/E-commerce
2
95242
<reponame>ervinpepic/E-commerce import braintree from braintree.resource import Resource class CoinbaseAccount(Resource): def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "subscriptions" in attributes: self.subscriptions = [braintree.subscription....
[ 1, 529, 276, 1112, 420, 29958, 261, 3845, 412, 16447, 29914, 29923, 29899, 22529, 13, 5215, 4105, 524, 929, 13, 3166, 4105, 524, 929, 29889, 10314, 1053, 18981, 13, 13, 1990, 3189, 262, 3188, 10601, 29898, 6848, 1125, 13, 1678, 822, 4...
tests/auth_test.py
moeyensj/adam_home
9
1606589
import json import unittest from adam import Auth from adam.rest_proxy import _RestProxyForTest # This test suite is testing authentication, but authentication is not really done through this # API. Authentication (i.e. adding authentication credentials to HTTP requests) is handled in # AuthenticatingRestProxy. Keep...
[ 1, 1053, 4390, 13, 5215, 443, 27958, 13, 13, 3166, 594, 314, 1053, 13189, 13, 3166, 594, 314, 29889, 5060, 29918, 14701, 1053, 903, 15078, 14048, 2831, 3057, 13, 13, 13, 29937, 910, 1243, 9460, 338, 6724, 10760, 29892, 541, 10760, 338...
examples/simple_email_pattern.py
Mattlk13/python-cybox
40
161095
#!/usr/bin/env python # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. """Creates the CybOX content for CybOX_Simple_Email_Pattern.xml """ from cybox.core import Observables from cybox.objects.email_message_object import EmailMessage def main(): m = EmailM...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 29892, 450, 341, 1806, 1525, 15025, 29889, 2178, 10462, 21676, 29889, 13, 29937, 2823, 365, 2965, 1430, 1660, ...
notebooks/_solutions/05-spatial-operations-overlays11.py
jorisvandenbossche/DS-python-geospatial
58
36103
# Calculate the intersection of the land use polygons with Muette land_use_muette = land_use.geometry.intersection(muette)
[ 1, 396, 20535, 403, 278, 17686, 310, 278, 2982, 671, 1248, 4790, 787, 411, 8229, 2353, 13, 1049, 29918, 1509, 29918, 2589, 2353, 353, 2982, 29918, 1509, 29889, 19156, 29889, 1639, 2042, 29898, 2589, 2353, 29897, 2 ]
scorecard/views.py
desafinadude/municipal-data
0
1612110
from django.shortcuts import redirect from django.views.generic.base import TemplateView from django.http import Http404, HttpResponse from django.urls import reverse from scorecard.profiles import get_profile from scorecard.models import Geography, LocationNotFound from infrastructure.models import Project from house...
[ 1, 515, 9557, 29889, 12759, 7582, 29879, 1053, 6684, 13, 3166, 9557, 29889, 7406, 29889, 19206, 29889, 3188, 1053, 25663, 1043, 13, 3166, 9557, 29889, 1124, 1053, 9056, 29946, 29900, 29946, 29892, 9056, 5103, 13, 3166, 9557, 29889, 26045, ...
h1theswan_utils/treefiles/treefile_utils.py
h1-the-swan/h1theswan_utils
0
84308
import pandas as pd import numpy as np class Treefile(object): """Tools for working with a treefile (.tree)""" def __init__(self, fname=None, comment_char="#", field_sep=" ", cluster_sep=":"): """ :fname: filename for the treefil...
[ 1, 1053, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 13, 1990, 15472, 1445, 29898, 3318, 1125, 13, 13, 1678, 9995, 24183, 363, 1985, 411, 263, 5447, 1445, 14544, 8336, 5513, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29...
tests/conftest.py
marqov/procrastinate
0
44025
<filename>tests/conftest.py<gh_stars>0 import os import signal as stdlib_signal from contextlib import closing import aiopg import psycopg2 import pytest from psycopg2 import sql from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from procrastinate import aiopg_connector from procrastinate import app as app_m...
[ 1, 529, 9507, 29958, 21150, 29914, 535, 615, 342, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 5215, 7182, 408, 3659, 1982, 29918, 25436, 13, 3166, 3030, 1982, 1053, 14382, 13, 13, 5215, 7468, 459, 2988...
porthole/management/commands/brocade.py
jsayles/Porthole
0
9828
<filename>porthole/management/commands/brocade.py from django.core.management.base import BaseCommand, CommandError from django.conf import settings from porthole import models, brocade class Command(BaseCommand): help = "Command the Brocade switch stacks" args = "" requires_system_checks = False de...
[ 1, 529, 9507, 29958, 1971, 386, 1772, 29914, 21895, 29914, 26381, 29914, 6729, 6332, 29889, 2272, 13, 3166, 9557, 29889, 3221, 29889, 21895, 29889, 3188, 1053, 7399, 6255, 29892, 10516, 2392, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 1...
helpers/time.py
fswzb/autotrade
1
181598
<gh_stars>1-10 # coding:utf8 import datetime def is_weekend(now_time): return now_time.weekday() >= 5 #to get the latest trade day except_trade_day_list=['2015-05-01','2015-06-22','2015-09-03','2015-10-01','2015-10-02','2015-10-06', \ '2015-10-07','2015-10-08', '2016-04-04','2016-05-02','...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14137, 29901, 9420, 29947, 13, 13, 5215, 12865, 13, 13, 13, 1753, 338, 29918, 18448, 355, 29898, 3707, 29918, 2230, 1125, 13, 1678, 736, 1286, 29918, 2230, 2...
tet/i18n/__init__.py
koirikivi/tet
1
105074
import sys from pyramid.config import Configurator from pyramid.i18n import get_localizer, TranslationStringFactory from pyramid.threadlocal import get_current_request def add_renderer_globals(event): request = event.get('request') if request is None: request = get_current_request() event['_'] ...
[ 1, 1053, 10876, 13, 13, 3166, 11451, 2572, 333, 29889, 2917, 1053, 12782, 332, 1061, 13, 3166, 11451, 2572, 333, 29889, 29875, 29896, 29947, 29876, 1053, 679, 29918, 2997, 3950, 29892, 4103, 18411, 1231, 5126, 13, 3166, 11451, 2572, 333, ...
Wrappers/Python/cil/processors/Masker.py
ClaireDelplancke/CCPi-Framework
30
75693
<reponame>ClaireDelplancke/CCPi-Framework # -*- coding: utf-8 -*- # This work is part of the Core Imaging Library (CIL) developed by CCPi # (Collaborative Computational Project in Tomographic Imaging), with # substantial contributions by UKRI-STFC and University of Manchester. # Licensed under the Apache Lic...
[ 1, 529, 276, 1112, 420, 29958, 20216, 533, 13157, 9018, 10055, 29914, 4174, 12197, 29899, 16660, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 259, 910, 664, 338, 760, 310, 278, 10239, 1954...
mpf/devices/segment_display/transitions.py
haggispinball/mpf_fathom_fast
163
64855
"""Text transitions used for segment displays.""" import abc from typing import Optional, List from mpf.core.placeholder_manager import TextTemplate from mpf.core.rgb_color import RGBColor from mpf.devices.segment_display.segment_display_text import SegmentDisplayText, UncoloredSegmentDisplayText STEP_OUT_OF_RANGE_ER...
[ 1, 9995, 1626, 1301, 2187, 1304, 363, 10768, 14423, 1213, 15945, 13, 5215, 25638, 13, 3166, 19229, 1053, 28379, 29892, 2391, 13, 13, 3166, 286, 7810, 29889, 3221, 29889, 27074, 29918, 12847, 1053, 3992, 6733, 13, 3166, 286, 7810, 29889, ...
setup_cares.py
thedrow/pycares
0
37396
import errno import os import subprocess import sys from distutils import log from distutils.command.build_ext import build_ext from distutils.errors import DistutilsError def exec_process(cmdline, silent=True, catch_enoent=True, input=None, **kwargs): """Execute a subprocess and returns the returncode, stdout ...
[ 1, 29871, 13, 5215, 4589, 1217, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 5215, 10876, 13, 13, 3166, 1320, 13239, 1053, 1480, 13, 3166, 1320, 13239, 29889, 6519, 29889, 4282, 29918, 1062, 1053, 2048, 29918, 1062, 13, 3166, 1320, 13239, ...
user_service/resources/auth.py
lewisemm/vistagrid-backend-k8
0
67379
<filename>user_service/resources/auth.py from flask_jwt_extended import ( create_access_token, jwt_required, get_jwt_identity ) from flask_restful import reqparse, Resource from user_service.models import User as UserModel class UserAuth(Resource): def __init__(self): self.parser = reqparse.Re...
[ 1, 529, 9507, 29958, 1792, 29918, 5509, 29914, 13237, 29914, 5150, 29889, 2272, 13, 3166, 29784, 29918, 29926, 14554, 29918, 1062, 2760, 1053, 313, 13, 1678, 1653, 29918, 5943, 29918, 6979, 29892, 13, 1678, 432, 14554, 29918, 12403, 29892, ...
mumbleroni/tests/test_settings_datastructure.py
Peter-Morawski/MumbleRoni
1
141147
# -*- coding: utf-8 -*- import os import unittest from ..settings.datastructure import Settings class SettingsDataStructureTests(unittest.TestCase): def setUp(self): self._host = "example.domain.com" self._port = 1337 self._user = "MumbleRoni" self._password = "<PASSWORD>" ...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 5215, 443, 27958, 13, 3166, 6317, 11027, 29889, 4130, 7614, 12425, 1053, 19215, 13, 13, 13, 1990, 19215, 1469, 5015, 12425, 24376, ...
3rdParty/Berkeley-DB/db-5.3.21.NC/build.py
rtobar/askapsoft
1
73346
import os from askapdev.rbuild.builders import Autotools as Builder import askapdev.rbuild.utils as utils builder = Builder(buildsubdir="build_unix", confcommand='../dist/configure') builder.remote_archive = "db-5.3.21.NC.tar.gz" if os.uname()[4] == 'x86_64': builder.add_option('--with-pic') #...
[ 1, 1053, 2897, 13, 13, 3166, 2244, 481, 3359, 29889, 29878, 4282, 29889, 4282, 414, 1053, 5202, 327, 8789, 408, 5373, 2700, 13, 5215, 2244, 481, 3359, 29889, 29878, 4282, 29889, 13239, 408, 3667, 29879, 13, 13, 16409, 353, 5373, 2700, ...
server/form/mongo.py
SRM-IST-KTR/ossmosis
6
3550
import os from pymongo import MongoClient from dotenv import load_dotenv def database_entry(data): try: load_dotenv() mongo_string = os.getenv('MONGODB_AUTH_URI') client = MongoClient(mongo_string) database = client[os.getenv('MONGODB_DB')] col = database['users'] c...
[ 1, 1053, 2897, 13, 3166, 282, 962, 7443, 1053, 18294, 4032, 13, 3166, 8329, 6272, 1053, 2254, 29918, 6333, 6272, 13, 13, 13, 1753, 2566, 29918, 8269, 29898, 1272, 1125, 13, 1678, 1018, 29901, 13, 4706, 2254, 29918, 6333, 6272, 580, 13...
tests/test_asyncio.py
adityaoza1901/AioContext
37
100568
<filename>tests/test_asyncio.py<gh_stars>10-100 import asyncio import pytest @asyncio.coroutine def _check_update_context(context): assert context == {'key1': 'value1'} context['key1'] = 'value2' context['key2'] = 'value2' assert context == {'key1': 'value2', 'key2': 'value2'} @pytest.mark.asyncio ...
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 294, 948, 3934, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 408, 948, 3934, 13, 13, 5215, 11451, 1688, 13, 13, 13, 29992, 294, 9...
rubin_sim/maf/mafContrib/GRBTransientMetric.py
RileyWClarke/flarubin
0
1602206
from builtins import zip # Gamma-ray burst afterglow metric # <EMAIL> import rubin_sim.maf.metrics as metrics import numpy as np __all__ = ['GRBTransientMetric'] class GRBTransientMetric(metrics.BaseMetric): """Detections for on-axis GRB afterglows decaying as F(t) = F(1min)((t-t0)/1min)^-alpha. No jet break...
[ 1, 515, 4240, 1144, 1053, 14319, 13, 29937, 402, 2735, 29899, 764, 20887, 1156, 29887, 677, 12714, 13, 29937, 529, 26862, 6227, 29958, 13, 13, 5215, 14051, 262, 29918, 3601, 29889, 655, 29888, 29889, 2527, 10817, 408, 21556, 13, 5215, 1...
graph_search/week2/assignment_dijkstra_shortest_paths.py
liaoaoyuan97/standford_algorithms_specialization
0
5595
import heapq import time from os import path from math import floor class Heap: def __init__(self): self.size = 0 self.array = [] self.v2index_map = {} def __get_parent_index(self, idx): return int(floor((idx - 1) / 2)) def __get_left_child_index(self, idx): retur...
[ 1, 1053, 16947, 29939, 13, 5215, 931, 13, 3166, 2897, 1053, 2224, 13, 3166, 5844, 1053, 11904, 13, 13, 13, 1990, 940, 481, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 2311, 353, 29871, 29900, 13, 4706, ...
examples/ex_bit_flip_code.py
jasonelhaderi/pypsqueak
0
110933
import context # Remove this import if running with pip installed version. from pypsqueak.api import qReg, qOp from pypsqueak.gates import X, Z, I, ROT_Y, CNOT from pypsqueak.noise import b_flip_map import numpy as np import sys if len(sys.argv) > 1 and int(sys.argv[1]) > 0: n_trials = int(sys.argv[1]) else: ...
[ 1, 1053, 3030, 29871, 396, 15154, 445, 1053, 565, 2734, 411, 8450, 5130, 1873, 29889, 13, 13, 3166, 11451, 567, 802, 557, 29889, 2754, 1053, 3855, 4597, 29892, 3855, 11746, 13, 3166, 11451, 567, 802, 557, 29889, 29887, 1078, 1053, 1060,...
devices/parser/serializers.py
City-of-Helsinki/hel-data-pipe
1
19250
<reponame>City-of-Helsinki/hel-data-pipe from rest_framework import serializers from .models import Device, SensorType class SensorTypeSerializer(serializers.ModelSerializer): class Meta: model = SensorType fields = "__all__" class DeviceSerializer(serializers.HyperlinkedModelSerializer): c...
[ 1, 529, 276, 1112, 420, 29958, 16885, 29899, 974, 29899, 29950, 1379, 682, 29875, 29914, 3952, 29899, 1272, 29899, 17760, 13, 3166, 1791, 29918, 4468, 1053, 7797, 19427, 13, 13, 3166, 869, 9794, 1053, 21830, 29892, 317, 6073, 1542, 13, ...
tests/unit/test_client.py
Omegaice/smartcontainers
6
165916
<gh_stars>1-10 # -*- coding: utf-8 -*- """Tests for Smart Containers Docker API Client. Testing for Smart Containers Client. This module extends the docker-py package to provide the ability to add metadata to docker containers. It is meant to be a drop-in replacement the docker-py package Client module. Existing meth...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 24376, 363, 4116, 442, 2866, 475, 414, 20868, 3450, 12477, 29889, 13, ...
neo/io/plexonio.py
michaelfsp/python-neo
1
52859
<filename>neo/io/plexonio.py # encoding: utf-8 """ Class for reading data from Plexion acquisition system (.plx) Compatible with versions 100 to 106. Other versions have not been tested. This IO is developed thanks to the header file downloadable from: http://www.plexon.com/downloads.html Depend on: Supported : Re...
[ 1, 529, 9507, 29958, 11496, 29914, 601, 29914, 10709, 14642, 29889, 2272, 13, 29937, 8025, 29901, 23616, 29899, 29947, 13, 15945, 29908, 13, 2385, 363, 5183, 848, 515, 349, 2506, 291, 1274, 23493, 1788, 14544, 572, 29916, 29897, 13, 13, ...
beta_version.py
JeanneGasser/basic_cypting
0
191086
# -*- coding: utf-8 -*- """ Created on Tue Nov 20 16:56:32 2018 @author: jeann """ from nltk import RegexpTokenizer toknizer = RegexpTokenizer(r'''\w'|\w+|[^\w\s]''') from string import punctuation import unidecode #Class construction class EncryptDecrypt: """ For each letter return the numeri...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 15945, 19451, 13, 20399, 373, 323, 434, 2864, 29871, 29906, 29900, 29871, 29896, 29953, 29901, 29945, 29953, 29901, 29941, 29906, 29871, 29906, 29900,...
tests/unit/test_openstack_group_service.py
venumurthy/ec2-driver
0
163580
<reponame>venumurthy/ec2-driver<gh_stars>0 import unittest from mock import Mock from novaclient.v1_1.security_groups import SecurityGroupManager from nova.virt.ec2.openstack_group_service import OpenstackGroupService class TestOpenstackGroupService(unittest.TestCase): def setUp(self): self.security_gr...
[ 1, 529, 276, 1112, 420, 29958, 854, 398, 332, 21155, 29914, 687, 29906, 29899, 9465, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 13, 3166, 11187, 1053, 26297, 13, 3166, 2420, 562, 1593, 29889, 29894, 29896, 2...
yuntu/dataset/base.py
CONABIO/yuntu
0
68250
<reponame>CONABIO/yuntu<filename>yuntu/dataset/base.py from abc import abstractmethod, ABCMeta import yuntu.dataset.methods as dsetMethods class metaDataset(object): __metaclass__ = ABCMeta @abstractmethod def getType(self): pass @abstractmethod def getDefaultConfig(self): pass ...
[ 1, 529, 276, 1112, 420, 29958, 6007, 2882, 5971, 29914, 29891, 4159, 29966, 9507, 29958, 29891, 4159, 29914, 24713, 29914, 3188, 29889, 2272, 13, 3166, 25638, 1053, 9846, 5696, 29892, 16417, 19346, 13, 5215, 343, 4159, 29889, 24713, 29889, ...
src/OTLMOW/OTLModel/Classes/WVConsole.py
davidvlaminck/OTLClassPython
2
186458
<reponame>davidvlaminck/OTLClassPython # coding=utf-8 from OTLMOW.OTLModel.Classes.AIMNaamObject import AIMNaamObject from OTLMOW.GeometrieArtefact.PuntGeometrie import PuntGeometrie # Generated with OTLClassCreator. To modify: extend, do not edit class WVConsole(AIMNaamObject, PuntGeometrie): """Een draagconstru...
[ 1, 529, 276, 1112, 420, 29958, 29881, 16093, 29894, 5288, 262, 384, 29914, 2891, 29931, 2385, 11980, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 3166, 438, 14632, 6720, 29956, 29889, 2891, 29931, 3195, 29889, 27403, 29889, 29909, 7833,...
python/remap.py
rmu75/rover-342-retrofit
0
82201
from stdglue import *
[ 1, 515, 3659, 3820, 434, 1053, 334, 13, 2 ]
train-cats.py
adamklein/keras-yolo3
0
55050
""" Derived from keras-yolo3 train.py (https://github.com/qqwweee/keras-yolo3), with additions from https://github.com/AntonMu/TrainYourOwnYOLO. """ import os import sys import argparse import pickle import numpy as np import keras.backend as K from keras.layers import Input, Lambda from keras.models import Model fr...
[ 1, 9995, 13, 15383, 2347, 515, 13023, 294, 29899, 29891, 3543, 29941, 7945, 29889, 2272, 313, 991, 597, 3292, 29889, 510, 29914, 24349, 29893, 705, 3905, 29914, 3946, 294, 29899, 29891, 3543, 29941, 511, 13, 2541, 788, 2187, 515, 2045, ...
src/tokenizers.py
tomfran/caselaw-temporal-analysis
0
97271
import os import spacy import json os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' class BatchTokenizer(): def __init__(self): self.nlp = spacy.load("en_core_web_md") def tokenize(self, documents): tokens = [] for doc in self.nlp.pipe(documents, batch_size = 30): ...
[ 1, 1053, 2897, 13, 5215, 805, 4135, 13, 5215, 4390, 13, 13, 359, 29889, 21813, 1839, 8969, 29918, 6271, 29925, 29918, 16173, 29918, 14480, 29918, 1307, 29963, 6670, 2033, 353, 525, 29941, 29915, 29871, 13, 308, 13, 1990, 350, 905, 6066,...
crits/exploits/urls.py
dutrow/crits
738
49629
from django.conf.urls import url from . import views urlpatterns = [ url(r'^add/$', views.add_exploit, name='crits-exploits-views-add_exploit'), url(r'^edit/cve/$', views.edit_exploit_cve, name='crits-exploits-views-edit_exploit_cve'), url(r'^edit/name/(?P<id_>\S+)/$', views.edit_exploit_name, name='crits...
[ 1, 515, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 13, 3166, 869, 1053, 8386, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 29898, 29878, 29915, 29985, 1202, 13346, 742, 8386, 29889, 1202, 29918, 4548, 417, 277, 29892, 102...
python_modules/dagster-graphql/dagster_graphql_tests/graphql/snapshots/snap_test_solids.py
zzztimbo/dagster
0
197932
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['test_query_all_solids 1'] = { 'usedSolids': [ { '__typename': 'UsedSolid', 'definition': { ...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 15101, 845, 1501, 342, 29901, 325, 29896, 448, 2045, 597, 1484, 29877, 29889, 3820, 29914, 29920, 29907, 29946, 29891, 29965, 29883, 13, 3166, 4770,...
setup.py
yuvipanda/fakeokclient
0
33917
import setuptools setuptools.setup( name="fakeokpy", version='0.1', url="https://github.com/yuvipanda/fakeokpy", author="<NAME>", author_email="<EMAIL>", license="BSD-3-Clause", packages=setuptools.find_packages(), )
[ 1, 1053, 731, 21245, 8789, 13, 13, 842, 21245, 8789, 29889, 14669, 29898, 13, 1678, 1024, 543, 29888, 1296, 554, 2272, 613, 13, 1678, 1873, 2433, 29900, 29889, 29896, 742, 13, 1678, 3142, 543, 991, 597, 3292, 29889, 510, 29914, 29891, ...
modules/astrom_test_2.py
rsiverd/ultracool
0
181741
#!/usr/bin/env python # vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 : # # Second cut at astrometry fitting for UCD project. # # <NAME> # Created: 2021-08-30 # Last modified: 2021-08-30 #-------------------------------------------------------------------------- #*******************************************...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 325, 326, 29901, 731, 934, 22331, 29922, 9420, 29899, 29947, 18696, 29922, 29946, 380, 29879, 29922, 29946, 2381, 29922, 29946, 634, 3252, 29922, 29947, 29900, 584, 13, 29937, 13, ...
main.py
SaintBuddha/UCU_LinuxClub_GitHW
0
140358
<reponame>SaintBuddha/UCU_LinuxClub_GitHW<gh_stars>0 from os import system, name import cowsay import json import random CHARACTERS = ["beavis", "cheese", "daemon", "cow", "dragon", "ghostbusters", "kitty", "meow", "milk", "stegosaurus", "stimpy", "turkey", "turtle", "tux"] def get_character(): ""...
[ 1, 529, 276, 1112, 420, 29958, 22211, 29933, 566, 29881, 2350, 29914, 23129, 29965, 29918, 24085, 6821, 431, 29918, 28712, 29950, 29956, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 2897, 1053, 1788, 29892, 1024, 13, 5215, 274, ...
metalgrafica/metalgrafica/doctype/plantilla_de_grupo_de_productos/plantilla_de_grupo_de_productos.py
Nirchains/metal
0
132129
# -*- coding: utf-8 -*- # Copyright (c) 2017, <NAME> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class Plantilladegrupodeproductos(Document): def validate(self): from erpnext.utilities.transac...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 29892, 529, 5813, 29958, 322, 17737, 29560, 13, 29937, 1152, 19405, 2472, 29892, ...
src/pyft4222/wrapper/i2c/slave.py
lavovaLampa/pyft4222
0
51407
<filename>src/pyft4222/wrapper/i2c/slave.py<gh_stars>0 from ctypes import POINTER, byref, c_char_p from ctypes import c_void_p, c_uint8, c_uint16, c_bool from typing import NewType from ..dll_loader import ftlib from .. import FtHandle, Result, Ok, Err, Ft4222Exception, Ft4222Status I2cSlaveHandle = NewType("I2cSla...
[ 1, 529, 9507, 29958, 4351, 29914, 2272, 615, 29946, 29906, 29906, 29906, 29914, 17699, 29914, 29875, 29906, 29883, 29914, 29879, 18398, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 274, 8768, 1053, 349, 6992, 4945, 2...
test/psyke/classification/real/test_real.py
psykei/psyke-python
2
179137
<reponame>psykei/psyke-python import unittest from parameterized import parameterized_class from tuprolog.solve.prolog import prolog_solver from psyke import logger from test import get_in_rule from test.psyke import initialize, data_to_struct @parameterized_class(initialize('real')) class TestReal(unittest.TestCase)...
[ 1, 529, 276, 1112, 420, 29958, 567, 29891, 446, 29875, 29914, 567, 29891, 446, 29899, 4691, 13, 5215, 443, 27958, 13, 3166, 3443, 1891, 1053, 3443, 1891, 29918, 1990, 13, 3166, 5291, 771, 1188, 29889, 2929, 345, 29889, 771, 1188, 1053, ...
Python-Intermetiate/04_regular_expressions.py
carlosmertens/Django-Full-Stack
0
139408
# REGULAR EXPRESSIONS # Start by importing "re" for Reglar Expressions import re patterns = ["term1", "term2"] text = "This is a string with term1, but not the other!" # Search with re print("\n** Regular Expression - Search") for pattern in patterns: print("*Serching for: " + pattern) if re.search(patter...
[ 1, 396, 5195, 29954, 13309, 1718, 8528, 15094, 13507, 29903, 13, 13, 29937, 7370, 491, 28348, 376, 276, 29908, 363, 2169, 4675, 14657, 1080, 13, 13, 5215, 337, 13, 13, 11037, 29879, 353, 6796, 8489, 29896, 613, 376, 8489, 29906, 3108, ...
setup.py
mariocesar/boot.py
2
30074
<reponame>mariocesar/boot.py<filename>setup.py #!/usr/bin/env python3 import sys from setuptools import find_packages, setup if sys.version_info < (3, 6): sys.exit('Python 3.6 is the minimum required version') description, long_description = ( open('README.rst', 'rt').read().split('\n\n', 1)) setup( nam...
[ 1, 529, 276, 1112, 420, 29958, 29885, 1306, 542, 26892, 29914, 4777, 29889, 2272, 29966, 9507, 29958, 14669, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 5215, 10876, 13, 13, 3166, 731, 21245, 8789, 1053...