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
weather.py
shuiyouren/weather-python
1
43225
<gh_stars>1-10 # -*- coding: utf-8 -*- import requests import sys import os # curent_dir = os.path.dirname(__file__) # print(curent_dir) # sys.path.append(curent_dir) from bs4 import BeautifulSoup from .weather_id import mylist def show_weather(sumht,sumwea): str = None try: l1 = '温度:'+sumht[0] ...
[ 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, 13, 5215, 7274, 13, 5215, 10876, 13, 5215, 2897, 13, 29937, 3151, 296, 29918, 3972...
tests/integration/application/test_attribute_server_and_client.py
microprediction/predictionserver
1
24806
<filename>tests/integration/application/test_attribute_server_and_client.py from predictionserver.clientmixins.attributereader import ( AttributeReader, AttributeType, AttributeGranularity ) from predictionserver.set_config import MICRO_TEST_CONFIG from predictionserver.servermixins.attributeserver import Attribute...
[ 1, 529, 9507, 29958, 21150, 29914, 27925, 29914, 6214, 29914, 1688, 29918, 12715, 29918, 2974, 29918, 392, 29918, 4645, 29889, 2272, 13, 3166, 18988, 2974, 29889, 4645, 28084, 1144, 29889, 1131, 1091, 329, 406, 1664, 1053, 313, 13, 1678, ...
vis/app/xblock/data/pad.py
ImperialNLP/X-Block
0
162102
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File : pad.py # Author : <NAME> <<EMAIL>> # Date : 01.11.2020 # Last Modified Date: 09.11.2021 # Last Modified By : <NAME> <<EMAIL>> # # Copyright (c) 2020, Imperial College, London # All rights reserved. # Redistribution and use in ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 3497, 795, 584, 17132, 29889, 2272, 13, 29937, 13361, 9651, 584, 529, 5813, 29958, 3532, ...
tools/gen-precalc-tables.py
andrejo/zxmaze3d
4
42110
#! /usr/bin/env python3 import math import decimal N_DIRECTIONS = 256 # If rounded up to 384 and last element has max value, it has the bit # pattern, that prevents bisection from searching past the last element. N_PRECALC_DRAW_DIST = 384 # Python round() uses "banker's rounding", i.e. "round half even" def roun...
[ 1, 396, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 5844, 13, 5215, 13677, 13, 13, 13, 29940, 29918, 4571, 1525, 9838, 29903, 353, 29871, 29906, 29945, 29953, 13, 13, 13, 29937, 960, 28240, 701, 304, 29871, ...
library/cohesity_agent.py
cohesity/cohesity-ansible-role
10
146876
#!/usr/bin/python # Copyright (c) 2018 Cohesity Inc # Apache License Version 2.0 from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import shutil import time from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_bytes...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29947, 315, 1148, 267, 537, 9266, 13, 29937, 13380, 19245, 10079, 29871, 29906, 29889, 29900, 13, 13, 3166, 4770, 29888, 9130, ...
source/upload_user_stats.py
CheyenneNS/metrics
0
174989
<reponame>CheyenneNS/metrics<gh_stars>0 import time import methods_upload_user_stats import datetime print("############################################") print("User Stats Upload (UTC): " + str(datetime.datetime.utcnow())) start_time = time.time() user_stats_dict = methods_upload_user_stats.get_user_info_from_auth2() ...
[ 1, 529, 276, 1112, 420, 29958, 26856, 29891, 4584, 3059, 29914, 2527, 10817, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 931, 13, 5215, 3519, 29918, 9009, 29918, 1792, 29918, 16202, 13, 5215, 12865, 13, 2158, 703, 13383, 13383...
subversion/tests/cmdline/svnlook_tests.py
jmckaskill/subversion
1
129021
<reponame>jmckaskill/subversion #!/usr/bin/env python # # svnlook_tests.py: testing the 'svnlook' tool. # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. # # ==================================================================== # Licensed to the Apache Softwar...
[ 1, 529, 276, 1112, 420, 29958, 21231, 384, 1278, 453, 29914, 1491, 3259, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 13, 29937, 29871, 3731, 29876, 6914, 29918, 21150, 29889, 2272, 29901, 29871, 6724, 278, 525, 2751...
src/EdgelistExtractor.py
centre-for-humanities-computing/ProdigalNetworks
0
58435
#!/usr/bin/env python # coding: utf-8 # import packages import re import pandas as pd from bs4 import BeautifulSoup from collections import defaultdict # Function definitions def extract_all_characters(soup): """ Function to extract characters from XML file of a play. Extracts the value of two tag attri...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 29937, 1053, 9741, 13, 5215, 337, 13, 5215, 11701, 408, 10518, 13, 3166, 24512, 29946, 1053, 25685, 29903, 1132, 13, 3166, 16250, 1053, ...
tests/test_utils/test_pywriting_utils.py
heylohousing/quickbase-client
0
549
import os from tempfile import TemporaryDirectory from quickbase_client.utils.pywriting_utils import BasicPyFileWriter from quickbase_client.utils.pywriting_utils import PyPackageWriter class TestBasicFileWriter: def test_outputs_lines(self): w = BasicPyFileWriter() w.add_line('import abc') ...
[ 1, 1053, 2897, 13, 3166, 5694, 1445, 1053, 6789, 1971, 653, 9882, 13, 13, 3166, 4996, 3188, 29918, 4645, 29889, 13239, 29889, 2272, 16554, 29918, 13239, 1053, 19219, 19737, 2283, 10507, 13, 3166, 4996, 3188, 29918, 4645, 29889, 13239, 298...
runtests.py
luzfcb/django-versioning
0
61228
<gh_stars>0 # -*- coding: utf-8 -*- import os import sys def main(): from django.conf import settings settings.configure( DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:' } }, INSTALLED_APPS = ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 515, 9557, 29889, 5527, 1053, 60...
graph.py
lokkelvin2/dc_tts
25
129291
from data_load import load_vocab from hyperparams import Hyperparams as hp from networks import TextEnc, AudioEnc, AudioDec, Attention, SSRN import tensorflow as tf class Graph: def __init__(self, num=1, mode="train"): ''' Args: num: Either 1 or 2. 1 for Text2Mel 2 for SSRN. m...
[ 1, 29871, 13, 3166, 848, 29918, 1359, 1053, 2254, 29918, 29894, 542, 370, 13, 3166, 11266, 7529, 1053, 26078, 7529, 408, 298, 29886, 13, 3166, 14379, 1053, 3992, 8566, 29892, 21764, 8566, 29892, 21764, 6185, 29892, 6212, 2509, 29892, 5886...
main.py
DonnC/retail-simulation
0
101951
<filename>main.py import simpy import random import os import datetime from transaction import transaction_from_dict from prettytable import PrettyTable # Specify the Column Names while initializing the Table myTable = PrettyTable( ["Agent", "Date", "Customer Number", "Amount", "Transaction Id"]) ACCOUNT_BALAN...
[ 1, 529, 9507, 29958, 3396, 29889, 2272, 13, 5215, 1027, 2272, 13, 5215, 4036, 13, 5215, 2897, 13, 5215, 12865, 13, 13, 3166, 10804, 1053, 10804, 29918, 3166, 29918, 8977, 13, 13, 3166, 5051, 2371, 1053, 4721, 4349, 3562, 13, 13, 29937...
selfbot/__init__.py
TibebeJS/tg-selfbot
1
117746
from .selfbot import *
[ 1, 515, 869, 1311, 7451, 1053, 334, 2 ]
checking/classes/mocking/doubles.py
igrekus/checking
4
177622
import builtins from typing import Any, List, Tuple from .calls import Call from .interfaces import Observer from .wrapper import AttributeWrapper def fake_builtins(): real_isinstance = builtins.isinstance def fake_isinstance(initial: Any, class_or_tuple: Any) -> bool: if real_isinstance(initial, Sp...
[ 1, 1053, 4240, 1144, 13, 3166, 19229, 1053, 3139, 29892, 2391, 29892, 12603, 552, 13, 13, 3166, 869, 29883, 4293, 1053, 8251, 13, 3166, 869, 1639, 8726, 1053, 4250, 2974, 13, 3166, 869, 17699, 1053, 23833, 15646, 13, 13, 13, 1753, 257...
bob/bio/base/test/dummy/preprocessor.py
bioidiap/bob.bio.base
16
138809
<gh_stars>10-100 from bob.bio.base.preprocessor import Preprocessor from bob.bio.base.database import BioFile import numpy numpy.random.seed(10) class DummyPreprocessor (Preprocessor): def __init__(self, return_none=False, probability_of_none=1, **kwargs): Preprocessor.__init__(self) self.return_none = retu...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 289, 711, 29889, 24840, 29889, 3188, 29889, 1457, 26482, 1053, 4721, 26482, 13, 3166, 289, 711, 29889, 24840, 29889, 3188, 29889, 9803, 1053, 21184,...
docs/modeling/code/timingExample.py
pramodsu/ILA-Tools
1
83874
<reponame>pramodsu/ILA-Tools Accelerator = ila.Abstraction('ExampleILA') # Define the Abstraction # Define the Interface write_grant = Accelerator.inp('write_grant', 1) # - request grant write_data = Accelerator.reg('write_data' , 32) # - data port...
[ 1, 529, 276, 1112, 420, 29958, 558, 314, 397, 2146, 29914, 29902, 4375, 29899, 24183, 13, 7504, 7367, 1061, 353, 980, 29874, 29889, 4920, 4151, 428, 877, 14023, 29902, 4375, 1495, 308, 396, 22402, 278, 1976, 4151, 428, 13, 462, 462, 4...
Auditor.py
bryanabsmith/Auditor
0
97871
#!/usr/bin/python import ipgetter import os import platform import subprocess import time import wx # TODO Clean up the code. # Licenced under the MIT Licence. See LICENCE for more details. class Auditor(wx.Frame): def __init__(self, parent, title): self.audit = "" self.version = "0.1 (b2)" ...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 13, 5215, 10377, 657, 357, 13, 5215, 2897, 13, 5215, 7481, 13, 5215, 1014, 5014, 13, 5215, 931, 13, 5215, 26437, 13, 13, 29937, 14402, 315, 14044, 701, 278, 775, 29889, 13, 13, 13, 29937...
democracy_bot/utils.py
TheDuckFIN/democracy-bot
0
82354
<gh_stars>0 """Utility functions""" import discord def get_name(member: discord.Member): """Returns nick primarily and falls back to username""" return member.name if member.nick is None else member.nick
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 7270, 537, 3168, 15945, 29908, 13, 13, 5215, 2313, 536, 13, 13, 13, 1753, 679, 29918, 978, 29898, 14242, 29901, 2313, 536, 29889, 13404, 1125, 13, 1678, 9995, 11609, 29879...
python/ql/test/2/library-tests/PointsTo/imports/test.py
vadi2/codeql
4,036
134900
from package import foo as myfoo
[ 1, 29871, 13, 3166, 3577, 1053, 7953, 408, 590, 5431, 13, 2 ]
pipeline/schemas/friend_invite.py
mystic-ai/pipeline
7
183281
from enum import Enum from .base import BaseModel class FriendInviteStatus(Enum): CREATED = "created" #: Friend has accepted the invite ACCEPTED = "accepted" #: The friend is still under trial period TRIAL = "trial" #: Cycle complete, the inviter has been credited COMPLETE = "complete" ...
[ 1, 515, 14115, 1053, 1174, 398, 13, 13, 3166, 869, 3188, 1053, 7399, 3195, 13, 13, 13, 1990, 20702, 12165, 568, 5709, 29898, 16854, 1125, 13, 1678, 14602, 29928, 353, 376, 11600, 29908, 13, 1678, 396, 29901, 20702, 756, 9259, 278, 243...
renewer/smtp.py
cloud-gov/legacy-domain-certificate-renewer
1
145467
<reponame>cloud-gov/legacy-domain-certificate-renewer from email.mime.text import MIMEText import smtplib import ssl from renewer.extensions import config def send_email(email, subject, body): msg = MIMEText(body, "html") msg["Subject"] = subject msg["To"] = email msg["From"] = config.SMTP_FROM ...
[ 1, 529, 276, 1112, 420, 29958, 9274, 29899, 13513, 29914, 1397, 4135, 29899, 7247, 29899, 6327, 8021, 29899, 28593, 556, 13, 3166, 4876, 29889, 29885, 603, 29889, 726, 1053, 341, 8890, 1626, 13, 5215, 1560, 9392, 1982, 13, 5215, 24250, ...
rtmlparse/templates/simplephotometry.py
thusser/rtml-parse
1
55853
from zope.interface import implementer from rtmlparse.irtml import ITemplate from rtmlparse.elements import * @implementer(ITemplate) class SimplePhotometry(object): name = "SimplePhotometry" type = Setup def __init__(self, element=None, rtml=None): # define our elements self.setup = None...
[ 1, 515, 503, 2300, 29889, 13248, 1053, 2334, 261, 13, 3166, 364, 2871, 5510, 29889, 2728, 828, 1053, 306, 6733, 13, 3166, 364, 2871, 5510, 29889, 17664, 1053, 334, 13, 13, 13, 29992, 326, 2037, 261, 29898, 1806, 331, 2341, 29897, 13, ...
designate/backend/impl_infoblox/record_factory.py
infobloxopen/designate
0
27355
<reponame>infobloxopen/designate # Copyright 2014 Infoblox # # 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 applicabl...
[ 1, 529, 276, 1112, 420, 29958, 7192, 711, 417, 29916, 3150, 29914, 13892, 403, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29946, 9969, 711, 417, 29916, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29...
swiftwind/core/exceptions.py
m-den-i/swiftwind
11
174826
<reponame>m-den-i/swiftwind class CannotCreateMultipleSettingsInstances(Exception): pass
[ 1, 529, 276, 1112, 420, 29958, 29885, 29899, 1145, 29899, 29875, 29914, 26792, 14800, 13, 1990, 15808, 4391, 15329, 552, 9585, 3379, 2925, 29898, 2451, 1125, 1209, 13, 2 ]
python/include/wl_oracle.py
bopopescu/Heimdallr
0
177879
#!/bin/env python #-*-coding:utf-8-*- import MySQLdb import string import sys reload(sys) sys.setdefaultencoding('utf8') import ConfigParser def get_item(data_dict,item): try: item_value = data_dict[item] return item_value except: pass def get_parameters(conn): try: curs=c...
[ 1, 18787, 2109, 29914, 6272, 3017, 13, 29937, 29899, 29930, 29899, 29883, 3689, 29901, 9420, 29899, 29947, 29899, 29930, 29899, 13, 13, 5215, 9254, 2585, 13, 5215, 1347, 13, 5215, 10876, 29871, 13, 28120, 29898, 9675, 29897, 29871, 13, 96...
sobolev_alignment/krr_approx.py
saroudant/sobolev_alignment
1
1606970
<reponame>saroudant/sobolev_alignment<filename>sobolev_alignment/krr_approx.py """ Encoder approximation by Kernel Ridge Regression @author: <NAME> This modules train a Kernel Ridge Regression (KRR) on a pair of samples (x_hat) and embeddings (z_hat) using two possible implementations: - scikit-learn: determinis...
[ 1, 529, 276, 1112, 420, 29958, 29879, 279, 2736, 424, 29914, 578, 833, 2608, 29918, 2520, 358, 29966, 9507, 29958, 578, 833, 2608, 29918, 2520, 358, 29914, 12748, 29878, 29918, 14850, 29889, 2272, 13, 15945, 29908, 11346, 6119, 16845, 491...
docs/conf.py
urm8/django-translations
100
6893
<reponame>urm8/django-translations # -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------...
[ 1, 529, 276, 1112, 420, 29958, 17095, 29947, 29914, 14095, 29899, 3286, 29880, 800, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 20999, 934, 363, 278, 317, 561, 14668, 5106, 128...
example.py
kaplanbr/Adversarial-Predictor
0
96507
# -*- coding: utf-8 -*- from AdversarialPredictor import AdversarialPredictionClassifier #dependencies %matplotlib inline import matplotlib.pyplot as plt import numpy as np from sklearn import datasets from sklearn.linear_model import LogisticRegression from sklearn.gaussian_process import GaussianProcessCl...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 30004, 13, 3166, 2087, 874, 27521, 23084, 919, 272, 1053, 2087, 874, 27521, 23084, 2463, 2385, 3709, 30004, 13, 30004, 13, 29937, 22594, 30004, 13...
Gym/web_athlete/models.py
Ahmadrezasamadi/django-internship
6
83688
from django.db import models from django.contrib.auth.models import User import datetime # Create your models here. class Time_option(models.Model): timee = models.CharField(max_length = 10) def __str__(self): return self.timee class Fields(models.Model): name = models.CharField(max_length = ...
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 5215, 12865, 13, 29937, 6204, 596, 4733, 1244, 29889, 13, 13, 1990, 5974, 29918, 3385, 29898, 9794, 29889, 3195, 1125, 13, 16...
src/ase2sprkkr/potentials/definitions/potential.py
ase2sprkkr/ase2sprkkr
1
143153
<gh_stars>1-10 """ Here, the format of the potential_file is defined """ from .sections import * def fce(): from ...common.misc import OrderedDict from ...common.grammar_types import \ Keyword, DefKeyword, Table, Array, Sequence, \ integer, Date, boolean, line_string from ..potential_definition...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 2266, 29892, 278, 3402, 310, 278, 7037, 29918, 1445, 338, 3342, 9995, 13, 13, 3166, 869, 27117, 1053, 334, 13, 13, 1753, 285, 346, 7295, 13, 29871, ...
Ch6/iris.py
quietcoolwu/MLCode
0
187161
<gh_stars>0 # Code from Chapter 6 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by <NAME> (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code comes with n...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 5920, 515, 23040, 29871, 29953, 310, 6189, 29257, 29901, 530, 29068, 293, 9034, 12645, 313, 29906, 299, 17138, 29897, 13, 29937, 491, 529, 5813, 29958, 313, 1124, 597, 1655, 9789, ...
lastfm.py
Metastruct/hal1320
1
164643
from sopel.module import commands from sopel.config import ConfigurationError from sopel.config.types import StaticSection, ValidatedAttribute import urllib, json class LastFMsection(StaticSection): path = ValidatedAttribute('apikey') def setup(bot): bot.config.define_section('lastfm', LastFMsection) def co...
[ 1, 515, 12103, 295, 29889, 5453, 1053, 8260, 13, 3166, 12103, 295, 29889, 2917, 1053, 20999, 2392, 13, 3166, 12103, 295, 29889, 2917, 29889, 8768, 1053, 624, 2454, 13438, 29892, 15758, 630, 6708, 13, 13, 5215, 3142, 1982, 29892, 4390, 1...
back/color.py
PoCInnovation/AI4UX
0
27906
<filename>back/color.py import extcolors import PIL def new_image(image, x1, y1, x2, y2): area = (x1, y1, x2, y2) tmp = image.crop(area) return tmp def nbColor_daltonisme(image, total): protanopie = [] # Ne voit pas le rouge deutéranopie = [] # Ne voit pas le vert tritanopie = [] # Ne voi...
[ 1, 529, 9507, 29958, 1627, 29914, 2780, 29889, 2272, 13, 5215, 1294, 27703, 13, 5215, 349, 6227, 13, 13, 13, 1753, 716, 29918, 3027, 29898, 3027, 29892, 921, 29896, 29892, 343, 29896, 29892, 921, 29906, 29892, 343, 29906, 1125, 13, 1678...
PFERD/crawl/ilias/__init__.py
Toorero/PFERD
74
127196
<filename>PFERD/crawl/ilias/__init__.py from .kit_ilias_web_crawler import KitIliasWebCrawler, KitIliasWebCrawlerSection __all__ = ["KitIliasWebCrawler", "KitIliasWebCrawlerSection"]
[ 1, 529, 9507, 29958, 13691, 1001, 29928, 29914, 29883, 1610, 29880, 29914, 2638, 294, 29914, 1649, 2344, 26914, 2272, 13, 3166, 869, 7354, 29918, 2638, 294, 29918, 2676, 29918, 29883, 1610, 1358, 1053, 26240, 29902, 18849, 3609, 29907, 1610...
blender/2.79/scripts/addons/add_mesh_extra_objects/geodesic_domes/__init__.py
uzairakbar/bpy2.79
2
66521
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
[ 1, 396, 16101, 22815, 402, 7390, 365, 2965, 1430, 1660, 350, 21339, 16101, 13, 29937, 13, 29937, 29871, 910, 1824, 338, 3889, 7047, 29936, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 13, 29937, 29871, 6623, 372, 1090, 278, 4958, ...
pyaud_plugins/_plugins/action.py
jshwi/pyaud-plugins
0
170014
""" pyaud_plugins._plugins.action ============================= """ import shutil import typing as t from pathlib import Path import pyaud from pyaud_plugins._abc import SphinxBuild from pyaud_plugins._environ import environ as e from pyaud_plugins._parsers import LineSwitch, Md2Rst from pyaud_plugins._utils import c...
[ 1, 9995, 13, 2272, 15052, 29918, 12800, 3032, 12800, 29889, 2467, 13, 9166, 4936, 2751, 29922, 13, 15945, 29908, 13, 5215, 528, 4422, 13, 5215, 19229, 408, 260, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 5215, 282, 3761, 566, 13, 13, ...
powerflow.py
simoncometto/PowerFlow
0
159449
# coding=utf-8 import numpy as np import scipy as sp import scipy.sparse as sparse import scipy.sparse.linalg as sparse_alg from time import time import IEEE_cdf as cdf from jacobian import jacobian from P_Q import P_Q class powerflow: ''' ''' def __init__(self, filename=''): n, mat_admitancia, lo...
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 5215, 12655, 408, 7442, 13, 5215, 4560, 2272, 408, 805, 13, 5215, 4560, 2272, 29889, 29879, 5510, 408, 29234, 13, 5215, 4560, 2272, 29889, 29879, 5510, 29889, 29880, 979, 29887, 408, 29234, ...
tests/test_filters.py
Ryanb58/algoliaqb
4
79598
from algoliaqb import AlgoliaQueryBuilder def test_normal_filters(): aqb = AlgoliaQueryBuilder( search_param="search", filter_map={ "is_reported": "is_reported" } ) flask_request_args = { "is_reported": True } filter_query = aqb.get_filter_query(flask_...
[ 1, 515, 3093, 18001, 29939, 29890, 1053, 11545, 18001, 3010, 5627, 13, 13, 13, 1753, 1243, 29918, 8945, 29918, 26705, 7295, 13, 1678, 263, 29939, 29890, 353, 11545, 18001, 3010, 5627, 29898, 13, 4706, 2740, 29918, 3207, 543, 4478, 613, ...
deepx/nn/stats.py
sharadmv/deepx
74
47543
import numpy as np from .. import T from ..layer import ShapedLayer from ..initialization import initialize_weights from .full import Linear from .. import stats __all__ = ['Gaussian', 'Bernoulli', 'IdentityVariance'] class Gaussian(Linear): def __init__(self, *args, **kwargs): self.cov_type = kwargs.p...
[ 1, 1053, 12655, 408, 7442, 13, 3166, 6317, 1053, 323, 13, 3166, 6317, 13148, 1053, 1383, 10501, 14420, 13, 3166, 6317, 11228, 2133, 1053, 11905, 29918, 705, 5861, 13, 3166, 869, 8159, 1053, 22985, 13, 13, 3166, 6317, 1053, 22663, 13, ...
packages/main/tests/python/test_pdf.py
ete99/rpaframework
2
1611911
from pathlib import Path import pytest from RPA.PDF import PDF RESOURCE_DIR = Path(__file__).resolve().parent / ".." / "resources" TEMP_DIR = Path(__file__).resolve().parent / ".." / "temp" imagesandtext_pdf = RESOURCE_DIR / "imagesandtext.pdf" invoice_pdf = RESOURCE_DIR / "invoice.pdf" vero_pdf = RESOURCE_DIR / "vero...
[ 1, 515, 2224, 1982, 1053, 10802, 13, 5215, 11451, 1688, 13, 3166, 390, 7228, 29889, 8493, 1053, 11328, 13, 13, 1525, 27839, 4741, 29918, 9464, 353, 10802, 22168, 1445, 1649, 467, 17863, 2141, 3560, 847, 376, 636, 29908, 847, 376, 13237,...
test/test_app.py
dmillington/lunchroulette
1
97595
import pytest from unittest.mock import MagicMock, patch from lunchroulette.models import SlackAccessToken, RouletteMessage # test / (hello world) def test_root(client): resp = client.get('/') assert resp.status_code == 200 assert resp.get_data() == b'Hello World' # test /begin_auth def test_begin_auth(cl...
[ 1, 1053, 11451, 1688, 13, 3166, 443, 27958, 29889, 17640, 1053, 26494, 18680, 29892, 13261, 13, 3166, 301, 3322, 27537, 20200, 29889, 9794, 1053, 317, 2364, 6638, 6066, 29892, 15915, 20200, 3728, 13, 13, 29937, 1243, 847, 313, 12199, 3186...
environment_data.py
Yacine22/test_dome
0
76110
<gh_stars>0 """ Environment Data ----- """ from tkinter import * class environement_data: global date, place, projectname, object_of_interest def __init__(self): self.envi_wind = Tk() self.envi_wind.attributes('-fullscreen', True) self.envi_wind.title('environment') ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 18649, 3630, 448, 807, 29871, 13, 15945, 29908, 13, 3166, 18883, 1639, 1053, 334, 13, 13, 13, 1990, 12471, 882, 29918, 1272, 29901, 13, 1678, 5534, 2635, 29892, 2058, ...
venv/lib/python3.6/site-packages/tensorflow/python/framework/cpp_shape_inference_pb2.py
yuxuan1995liu/darkflowyolo_detection
6
194726
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/python/framework/cpp_shape_inference.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goo...
[ 1, 396, 3251, 630, 491, 278, 9608, 6835, 6516, 29889, 29871, 11662, 6058, 11488, 29991, 13, 29937, 2752, 29901, 26110, 29914, 4691, 29914, 4468, 29914, 8223, 29918, 12181, 29918, 262, 1659, 29889, 17529, 13, 13, 5215, 10876, 13, 29918, 29...
Scripts/check_two_strings_are_anagrams.py
alexcamargos/Learning_Python_Programming
2
188866
# #!/usr/bin/env python # encoding: utf-8 # -------------------------------------------------------------------------------------------------------------------- # # Name: check_two_strings_are_anagrams.py # Version: 1.0 # # Summary: Find Whether Two Strings are Anagrams # An interesting application of the C...
[ 1, 396, 29871, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 29871, 8025, 29901, 23616, 29899, 29947, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 5634, 13, 29937, 13, 29937, 4408, 29901, 1423, 29918, 10184, 299...
lib.py
miami-acm/unit-testing
0
45317
#!/usr/bin/env python3 def sleep_in(weekday, vacation): """ The parameter weekday is True if it is a weekday, and the parameter vacation is True if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return True if we sleep in. sleep_in(False, False) → True sleep_in(T...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 13, 1753, 8709, 29918, 262, 29898, 18448, 3250, 29892, 11757, 362, 1125, 13, 1678, 9995, 13, 1678, 450, 3443, 4723, 3250, 338, 5852, 565, 372, 338, 263, 4723, 3250, 29892, ...
PlantAnalysis/sharpen_image.py
godzmaru/PlantAnalysis
0
113128
<reponame>godzmaru/PlantAnalysis #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 14 13:06:40 2018 @author: hendrawahyu """ import cv2 import numpy as np # ============================================================================= # This function is used to sharpen the image using a simple ker...
[ 1, 529, 276, 1112, 420, 29958, 17083, 29920, 3034, 29884, 29914, 3247, 424, 21067, 4848, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, ...
unwarp_models.py
zgjslc/Film-Recovery-master1
0
6639
import torch import torch.nn as nn import torch.nn.functional as F from models.misc import modules constrain_path = { ('threeD', 'normal'): (True, True, ''), ('threeD', 'depth'): (True, True, ''), ('normal', 'depth'): (True, True, ''), ('depth', 'normal'): (True, True, ''), } class UnwarpNet(nn.Modu...
[ 1, 1053, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 13, 3166, 4733, 29889, 29885, 10669, 1053, 10585, 13, 13, 3075, 6038, 29918, 2084, 353, 426, 13, 16...
t2/primes.py
Macelai/security
0
71958
import random import time BITS_LENGTH = [40, 56, 80, 128, 168, 224, 256, 512, 1024, 2048, 4096] def lcg(m: int, seed: int = None) -> int: a = 39177369995579819498972128804676596941198511312402174107900118507767888787985319889078498768125726538781142699985438519849879849879867913387985078149715117956575598705232...
[ 1, 1053, 4036, 13, 5215, 931, 13, 13, 13, 22698, 29903, 29918, 19433, 353, 518, 29946, 29900, 29892, 29871, 29945, 29953, 29892, 29871, 29947, 29900, 29892, 29871, 29896, 29906, 29947, 29892, 29871, 29896, 29953, 29947, 29892, 29871, 29906, ...
sherpa_client/models/engine_name.py
kairntech/sherpa-client
0
1610392
<filename>sherpa_client/models/engine_name.py<gh_stars>0 from typing import Any, Dict, Type, TypeVar import attr T = TypeVar("T", bound="EngineName") @attr.s(auto_attribs=True) class EngineName: """ """ name: str def to_dict(self) -> Dict[str, Any]: name = self.name field_dict: Dict[s...
[ 1, 529, 9507, 29958, 845, 261, 3274, 29918, 4645, 29914, 9794, 29914, 10599, 29918, 978, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 5167, 29892, 5167, 9037, 13, 13, 5215...
code/figures/5.0-plot-fig-S2.py
edunnsigouin/ds21grl
1
84287
""" Plots fig S2: Specifically, zonal-mean root-mean-square of stationary wave meridional wind at 850 hPa for both reanalysis and aquaplanet simulation data for ANNUAL and NDJFM. NOTE: since the reviewer asked for a measure of interannual variability in stationary wave amplitude, here we calculate stationary waves as...
[ 1, 9995, 13, 3247, 1862, 2537, 317, 29906, 29901, 13, 10299, 928, 635, 29892, 503, 7177, 29899, 12676, 3876, 29899, 12676, 29899, 17619, 310, 5073, 653, 10742, 2778, 333, 1848, 8805, 29871, 13, 271, 29871, 29947, 29945, 29900, 298, 11868,...
fpb/base/dask.py
cloudmercato/python-fpb
3
134244
<reponame>cloudmercato/python-fpb import multiprocessing import dask import dask.array as da import dask.dataframe as dd from fpb.base import common from fpb.base import numpy class BaseDaskRunner(numpy.BaseNumpyRunner): dd = dd da = da extra_data = { 'numpy_version': numpy.np.__version__, ...
[ 1, 529, 276, 1112, 420, 29958, 9274, 1050, 29883, 1219, 29914, 4691, 29899, 18091, 29890, 13, 5215, 6674, 307, 985, 292, 13, 5215, 270, 1278, 13, 5215, 270, 1278, 29889, 2378, 408, 1146, 13, 5215, 270, 1278, 29889, 1272, 2557, 408, 24...
examples/periodic2D/plot_diffraction_efficiencies.py
benvial/pytheas
10
99166
# -*- coding: utf-8 -*- """ Simulating diffraction by a 2D metamaterial =========================================== Finite element simulation of the diffraction of a plane wave by a mono-periodic grating and calculation of diffraction efficiencies. """ #################################################################...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 8942, 18099, 2923, 13857, 491, 263, 29871, 29906, 29928, 1539, 314, 3795, 13, 9166, 9166, 4936, 25512, 13, 13, 12881, 568, 1543, 17402,...
django_cradmin/uicontainer/container.py
appressoas/django_cradmin
11
32117
<reponame>appressoas/django_cradmin from django.conf import settings from django.forms.utils import flatatt from django_cradmin import renderable class NotBootsrappedError(Exception): """ Raised when trying to use features of :class:`.AbstractContainerRenderable` that requires is to have been bootstra...
[ 1, 529, 276, 1112, 420, 29958, 932, 1253, 29877, 294, 29914, 14095, 29918, 29883, 3665, 1195, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 9514, 29889, 13239, 1053, 12151, 1131, 13, 3166, 9557, 29918, 29883, 3665, 1195,...
pythonexercicios/ex042-analisandotrianguloV2.py
marroni1103/exercicios-pyton
0
108920
print('\033[34m-=\033[m'*12) print('Analisador de Trianulo') print('\033[34m-=\033[m'*12) a = float(input('Informe a primeira reta: ')) b = float(input('Informe a segunda reta: ')) c = float(input('Informe a terceira reta: ')) if a + b > c and a + c > b and b + c > a: print(f'Com essas retas {a} X {b} X {c} conse...
[ 1, 1596, 28909, 29900, 29941, 29941, 29961, 29941, 29946, 29885, 29899, 2013, 29900, 29941, 29941, 29961, 29885, 29915, 29930, 29896, 29906, 29897, 13, 2158, 877, 2744, 5711, 3136, 316, 323, 6392, 7207, 1495, 13, 2158, 28909, 29900, 29941, ...
src/quiche/ast_heuristic_cost_model.py
riswords/quiche
0
62851
from typing import Dict, Tuple from quiche.analysis import CostModel from quiche.egraph import ENode, EClassID from quiche.ast_quiche_tree import ASTQuicheTree class ASTHeuristicCostModel(CostModel): """ Cost model for AST nodes, based on "size", i.e., number of children and also a relative weighting for...
[ 1, 515, 19229, 1053, 360, 919, 29892, 12603, 552, 13, 13, 3166, 439, 4070, 29889, 15916, 1053, 9839, 3195, 13, 3166, 439, 4070, 29889, 387, 1140, 1053, 382, 4247, 29892, 382, 2385, 1367, 13, 3166, 439, 4070, 29889, 579, 29918, 339, 40...
src/waldur_openstack/openstack/migrations/0006_router.py
geant-multicloud/MCMS-mastermind
26
162937
# Generated by Django 2.2.13 on 2020-10-09 17:57 import django.db.models.deletion import django.utils.timezone import model_utils.fields from django.db import migrations, models import waldur_core.core.fields import waldur_core.core.models import waldur_core.core.shims import waldur_core.core.validators import waldur...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29896, 29941, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29896, 29900, 29899, 29900, 29929, 29871, 29896, 29955, 29901, 29945, 29955, 13, 13, 5215, 9557, 29889, 2585, 29889...
cymepy/export_manager/hooks/JSON_writer.py
GMLC-TDC/cymepy
1
36257
<gh_stars>1-10 from cymepy.export_manager.base_definations import ExportManager from cymepy.common import EXPORT_FILENAME import json import os class Writer(ExportManager): def __init__(self, sim_instance, solver, options, logger, **kwargs): super(Writer, self).__init__(sim_instance, solver, options, logge...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 274, 962, 1022, 29891, 29889, 15843, 29918, 12847, 29889, 3188, 29918, 25476, 800, 1053, 1222, 637, 3260, 13, 3166, 274, 962, 1022, 29891, 29889, 9435, 1053, 85...
drl_grasping/envs/models/primitives/__init__.py
Tiamat-Tech/drl_grasping
126
103702
from .box import Box from .cylinder import Cylinder from .sphere import Sphere from .random_primitive import RandomPrimitive from .plane import Plane
[ 1, 515, 869, 1884, 1053, 11773, 13, 3166, 869, 1270, 29880, 4995, 1053, 315, 2904, 4995, 13, 3166, 869, 29879, 9085, 1053, 317, 9085, 13, 3166, 869, 8172, 29918, 9469, 3321, 1053, 16968, 18213, 3321, 13, 3166, 869, 22116, 1053, 1858, ...
blog/models/__init__.py
sharif-42/Personal_Website
0
161530
<reponame>sharif-42/Personal_Website<filename>blog/models/__init__.py from .post import Post from .comments import Comment
[ 1, 529, 276, 1112, 420, 29958, 845, 279, 361, 29899, 29946, 29906, 29914, 7435, 284, 29918, 3609, 2746, 29966, 9507, 29958, 7312, 29914, 9794, 29914, 1649, 2344, 26914, 2272, 13, 3166, 869, 2490, 1053, 4918, 13, 3166, 869, 21032, 1053, ...
tests/e2e/utils.py
BeryJu/passbook
15
169884
"""authentik e2e testing utilities""" import json import os from functools import lru_cache, wraps from os import environ, makedirs from time import sleep, time from typing import Any, Callable, Optional from django.apps import apps from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.db...
[ 1, 9995, 5150, 296, 638, 321, 29906, 29872, 6724, 3667, 1907, 15945, 29908, 13, 5215, 4390, 13, 5215, 2897, 13, 3166, 2090, 312, 8789, 1053, 301, 582, 29918, 8173, 29892, 11463, 567, 13, 3166, 2897, 1053, 12471, 29892, 2136, 287, 12935,...
utils/visualize_tree.py
moyiming1/Retrosynthesis-pathway-ranking
10
10766
<gh_stars>1-10 import os, sys project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(project_path) import pickle def construct_tree_for_visual(tree, node_info_key, depth=0): tree_for_visual = {'smiles': 'http://askcos.mit.edu/draw/smiles/' + str(tree['smiles']).replace('#', '%2...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 29892, 10876, 13, 13, 4836, 29918, 2084, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, ...
cgnal/core/data/model/__init__.py
CGnal/cgnal-core
9
108719
""" Data model module. In this module the data types used in CGnal framework are defined. """
[ 1, 9995, 13, 1469, 1904, 3883, 29889, 13, 13, 797, 445, 3883, 278, 848, 4072, 1304, 297, 8446, 20809, 6890, 526, 3342, 29889, 13, 15945, 29908, 13, 2 ]
setup.py
eddo888/perdy
0
11972
#!/usr/bin/env python import codecs from os import path from setuptools import setup pwd = path.abspath(path.dirname(__file__)) with codecs.open(path.join(pwd, 'README.md'), 'r', encoding='utf8') as input: long_description = input.read() version='1.7' setup( name='Perdy', version=version, license='MIT', ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 775, 2395, 13, 3166, 2897, 1053, 2224, 13, 3166, 731, 21245, 8789, 1053, 6230, 13, 13, 29886, 9970, 353, 2224, 29889, 370, 1028, 493, 29898, 2084, 29889, 25721, 22168, 1445, ...
aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py
xxiao-1/timeShift
0
65194
<reponame>xxiao-1/timeShift import sm import aslam_cv as acv import aslam_cameras_april as acv_april import aslam_splines as asp import aslam_backend as aopt import bsplines import kalibr_common as kc import kalibr_errorterms as ket import IccCalibrator as ic import cv2 import sys import math import numpy as np import...
[ 1, 529, 276, 1112, 420, 29958, 4419, 29653, 29899, 29896, 29914, 2230, 29657, 13, 5215, 1560, 13, 5215, 408, 5288, 29918, 11023, 408, 1274, 29894, 13, 5215, 408, 5288, 29918, 29883, 4183, 294, 29918, 481, 4115, 408, 1274, 29894, 29918, ...
module3/itcc_test.py
jdahhan/Stem-Away-group-5
1
146337
import unittest from itcc import ITCC import pandas as pd class TestITCC(unittest.TestCase): def test_itcc_ingest(self): i = ITCC() df = i.get_path_matrix() self.assertEqual(type(df), pd.DataFrame) print(df.describe()) print("=" * 80) def test_getCXY(self): i =...
[ 1, 1053, 443, 27958, 13, 3166, 372, 617, 1053, 13315, 4174, 13, 5215, 11701, 408, 10518, 13, 13, 13, 1990, 4321, 1806, 4174, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 277, 617, 29918, 292, 342, 29898, 131...
mechlib/amech_io/parser/models.py
kevinmooreiii/mechdriver
1
71824
""" Parses the `models.dat` input file for MechDriver that specifies all of the parameters used to construct the partition functions and master equations for the calculation of rate constants and thermochemistry. """ import automol import ioformat from mechanalyzer.inf import thy as tinfo from mechlib.amech_i...
[ 1, 9995, 1459, 29879, 267, 278, 421, 9794, 29889, 4130, 29952, 1881, 934, 363, 2191, 305, 12376, 393, 1580, 11057, 599, 13, 1678, 310, 278, 4128, 1304, 304, 3386, 278, 8877, 3168, 322, 13, 1678, 5835, 10693, 363, 278, 13944, 310, 6554...
utils/csv_response_.py
baixuexue123/djmo
1
107926
<filename>utils/csv_response_.py<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import csv import codecs import cStringIO from django.http import StreamingHttpResponse from django.views.generic import View """ 流式响应StreamingHttpResponse可以快速,节省内存地产生一个大型文件 """ class Ech...
[ 1, 529, 9507, 29958, 13239, 29914, 7638, 29918, 5327, 5396, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, ...
Scripts/TypeRig GUI/Panel/Metrics.py
twardoch/TypeRig
1
67479
<reponame>twardoch/TypeRig<gh_stars>1-10 #FLM: Glyph: Metrics # ---------------------------------------- # (C) <NAME>, 2018 (http://www.kateliev.com) # (C) Karandash Type Foundry (http://www.karandash.eu) #----------------------------------------- # No warranties. By using this you agree # that you use it at your own ...
[ 1, 529, 276, 1112, 420, 29958, 29873, 1328, 2878, 29914, 1542, 29934, 335, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 10536, 29924, 29901, 402, 27026, 29901, 4737, 10817, 13, 29937, 448, 2683, 2683, 26589,...
application/create-application.py
superdiana/nexmo-python-code-snippets
0
95870
<filename>application/create-application.py #!/usr/bin/env python3 import nexmo from pprint import pprint client = nexmo.Client( key=NEXMO_API_KEY, secret=NEXMO_API_SECRET ) response = client.application_v2.create_application({ "name": "Code Example App", "capabilities": { "messages": { ...
[ 1, 529, 9507, 29958, 6214, 29914, 3258, 29899, 6214, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 5215, 452, 29916, 4346, 13, 3166, 282, 2158, 1053, 282, 2158, 13, 13, 4645, 353, 452, 29916, 4346, 2988...
python/ql/src/Classes/ConflictingAttributesInBaseClasses_Fixed.py
vadi2/codeql
4,036
172010
#Fixed by overriding. This does not change behavior, but makes it explicit and comprehensible. class ThreadingTCPServerOverriding(ThreadingMixIn, TCPServer): def process_request(self, request, client_address): #process_request forwards to do_work, so it is OK to call ThreadingMixIn.process_request ...
[ 1, 268, 13, 29937, 26262, 491, 20831, 292, 29889, 910, 947, 451, 1735, 6030, 29892, 541, 3732, 372, 6261, 322, 15171, 575, 1821, 29889, 13, 1990, 10480, 292, 29911, 6271, 6004, 3563, 2429, 292, 29898, 4899, 292, 29924, 861, 797, 29892, ...
cogandmem/text.py
aemacdermid/cogandmem
0
44270
""" Functions for displaying text to the screen. Text rendering in pygame does not allow for line breaks. This can lead to issues when attempting to render text, particularly if one is unsure of the width and height of a to-be-rendered string in a given font. The functions here handle these difficulties. This module ...
[ 1, 9995, 13, 6678, 29879, 363, 16384, 1426, 304, 278, 4315, 29889, 13, 13, 1626, 15061, 297, 22028, 947, 451, 2758, 363, 1196, 16706, 29889, 910, 508, 3275, 304, 13, 12175, 746, 15661, 304, 4050, 1426, 29892, 10734, 565, 697, 338, 964...
src/python/shared/BAData.py
dsyme/ADBench
58
98601
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from dataclasses import dataclass, field import numpy as np from shared.BASparseMat import BASparseMat from shared.output_utils import save_errors_to_file, objective_file_name,\ save_sparse_j_to_file, jacobian_file_na...
[ 1, 396, 14187, 1266, 313, 29883, 29897, 7783, 15025, 29889, 13, 29937, 10413, 21144, 1090, 278, 341, 1806, 19405, 29889, 13, 13, 3166, 848, 13203, 1053, 848, 1990, 29892, 1746, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 7258, 29889, 2993...
api/server/swagger_server/code_templates/serve_kubernetes.TEMPLATE.py
krishnakumar27/mlx
98
162275
# Copyright 2021 The MLX Contributors # # SPDX-License-Identifier: Apache-2.0 from kfp import dsl from kfp_tekton.compiler import TektonCompiler from kfp_tekton import TektonClient from os import path from tempfile import gettempdir ############################################################ # Define...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 450, 23158, 29990, 2866, 1091, 29560, 13, 29937, 29871, 13, 29937, 10937, 29928, 29990, 29899, 29931, 293, 1947, 29899, 12889, 29901, 13380, 29899, 29906, 29889, 29900, 29871, 13, 13, ...
is_core/config.py
cedel1/django-is-core
0
195925
from django.conf import settings as django_settings def _get_auth_login_view(): if ('auth_token' in django_settings.INSTALLED_APPS and getattr(django_settings, 'AUTH_TOKEN_TWO_FACTOR_ENABLED', False)): return 'auth_token.contrib.is_core_auth.views.TwoFactorLoginView' elif 'auth_token' in d...
[ 1, 515, 9557, 29889, 5527, 1053, 6055, 408, 9557, 29918, 11027, 13, 13, 13, 1753, 903, 657, 29918, 5150, 29918, 7507, 29918, 1493, 7295, 13, 1678, 565, 6702, 5150, 29918, 6979, 29915, 297, 9557, 29918, 11027, 29889, 25580, 1964, 20566, ...
contrib/grok-to-regex.py
bossjones/docker-compose-prometheus
0
151375
<reponame>bossjones/docker-compose-prometheus<filename>contrib/grok-to-regex.py<gh_stars>0 #!/usr/bin/env python import argparse import re from os import walk from os.path import join def get_patterns(patterns_dir): patterns = {} for (dirpath, _, filenames) in walk(patterns_dir): for name in filename...
[ 1, 529, 276, 1112, 420, 29958, 29890, 2209, 29926, 2873, 29914, 14695, 29899, 19438, 29899, 14032, 23043, 375, 29966, 9507, 29958, 21570, 29914, 29887, 16475, 29899, 517, 29899, 13087, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900...
gap/src/util/data_iterator.py
cosmozhang/autoencoding_parsing
0
13396
<gh_stars>0 from collections import OrderedDict, defaultdict import numpy as np ''' generate a id to length dic ''' def gen_sid_len(sentences): sid2len = OrderedDict() for i, sent in enumerate(sentences): sid2len[i] = len(sent) return sid2len def batch_slice(data, batch_size): # data is a li...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 16250, 1053, 8170, 287, 21533, 29892, 2322, 8977, 13, 5215, 12655, 408, 7442, 13, 13, 12008, 13, 17158, 263, 1178, 304, 3309, 12124, 13, 12008, 13, 1753, 2531, 29918, 29879, 333, ...
tensorflow_decision_forests/keras/test_runner.py
Saduf2019/decision-forests
1
171322
<filename>tensorflow_decision_forests/keras/test_runner.py # Copyright 2021 Google LLC. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # #...
[ 1, 529, 9507, 29958, 29056, 29918, 7099, 2459, 29918, 1454, 9197, 29914, 3946, 294, 29914, 1688, 29918, 27492, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 5087, 365, 12182, 29889, 13, 29937, 13, 29937, 10413, 211...
pypika/tests/dialects/test_mssql.py
uhrm/pypika
0
10045
<gh_stars>0 import unittest from pypika import Table from pypika.analytics import Count from pypika.dialects import MSSQLQuery from pypika.utils import QueryException class SelectTests(unittest.TestCase): def test_normal_select(self): q = MSSQLQuery.from_("abc").select("def") self.assertEqual('S...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 13, 3166, 282, 1478, 4106, 1053, 6137, 13, 3166, 282, 1478, 4106, 29889, 7054, 22026, 1053, 3917, 13, 3166, 282, 1478, 4106, 29889, 15321, 781, 29879, 1053, 341, ...
src/main.py
Quin-Darcy/Crawler
0
38249
<reponame>Quin-Darcy/Crawler import crawler import os def main(): root = crawler.Crawler() root.set_start() root.burrow() root.show() os.system('killall firefox') if __name__ == '__main__': main()
[ 1, 529, 276, 1112, 420, 29958, 2182, 262, 29899, 29928, 279, 1270, 29914, 29907, 1610, 1358, 13, 5215, 29349, 1358, 13, 5215, 2897, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 3876, 353, 29349, 1358, 29889, 29907, 1610, 1358, 580, 13, 167...
Exercicios em Python/ex080.py
Raphael-Azevedo/Exercicios_Python
0
12412
<gh_stars>0 n = [] i = 0 for c in range(0, 5): n1 = int(input('Digite um valor: ')) if c == 0 or n1 > n[-1]: n.append(n1) print(f'Adicionado na posição {c} da lista...') else: pos = 0 while pos < len(n): if n1 <= n[pos]: n.insert(pos, n1) ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29876, 353, 5159, 13, 29875, 353, 29871, 29900, 13, 1454, 274, 297, 3464, 29898, 29900, 29892, 29871, 29945, 1125, 13, 1678, 302, 29896, 353, 938, 29898, 2080, 877, 14991, 568, 1922, 16...
dataplotting.py
Shivams9/pythoncodecamp
6
186281
import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y = [7, 8, 11, 1.3, 16, 15, -1, -.2, 0, 3.3] # plt.figure(figsize=(0,1000)) # plt.xlim(0,100) # plt.ylim(-10,100) # fig=plt.figure() plt.scatter(x, y, color='green', marker='o') plt.plot(x, y, color='yellow', linewidth=10, alpha=0.5) plt.xlabel("Time...
[ 1, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 29916, 353, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 29892, 29871, 29953, 29892, 29871, 29955, 29892, 29871, 29947, 29892, 29871, 29...
Project-Euler-Solutions/020.py
KartikKannapur/HackerRank
0
167319
<reponame>KartikKannapur/HackerRank #Problem 20: #n! means n × (n − 1) × ... × 3 × 2 × 1 #For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800, #and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. #Find the sum of the digits in the number 100! import sympy as sp def main(num): val = sp...
[ 1, 529, 276, 1112, 420, 29958, 29968, 442, 638, 29968, 812, 481, 332, 29914, 29950, 28940, 29934, 804, 13, 29937, 26604, 29871, 29906, 29900, 29901, 13, 29937, 29876, 29991, 2794, 302, 13105, 313, 29876, 13935, 29871, 29896, 29897, 13105, ...
backend/user/permissions.py
HarsimratBhundar/gym-buddy
0
155292
<filename>backend/user/permissions.py from rest_framework import permissions from django.contrib.auth.models import User from rest_framework.authtoken.models import Token class UserAccessPermission(permissions.BasePermission): message = 'Invalid permission' def has_permission(self, request, view): if ...
[ 1, 529, 9507, 29958, 27852, 29914, 1792, 29914, 17858, 6847, 29889, 2272, 13, 3166, 1791, 29918, 4468, 1053, 11239, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 1791, 29918, 4468, 29889, 1300, 400, 4476, 2...
apns_proxy_client/core.py
hagino3000/apns-proxy-client-py
0
7442
<reponame>hagino3000/apns-proxy-client-py # -*- coding: utf-8 -*- """ APNS Proxy Serverのクライアント """ import time import zmq import simplejson as json READ_TIMEOUT = 1500 # msec FLUSH_TIMEOUT = 5000 # msec COMMAND_ASK_ADDRESS = b'\1' COMMAND_SEND = b'\2' COMMAND_FEEDBACK = b'\3' DEVICE_TOKEN_LENGTH = 64 JSON_ALERT...
[ 1, 529, 276, 1112, 420, 29958, 29882, 351, 1789, 29941, 29900, 29900, 29900, 29914, 481, 1983, 29899, 14701, 29899, 4645, 29899, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13,...
deep_ner/udpipe_data.py
bond005/elmo_ner
80
57974
<reponame>bond005/elmo_ner import re from typing import Set import spacy_udpipe from spacy_udpipe import UDPipeLanguage UNIVERSAL_POS_TAGS = ['ADJ', 'ADP', 'ADV', 'AUX', 'CCONJ', 'CONJ', 'DET', 'INTJ', 'NOUN', 'NUM', 'PART', 'PRON', 'PROPN', 'PUNCT', 'SCONJ', 'SYM', 'VERB', 'X'] UNIVERSAL_DEPEN...
[ 1, 529, 276, 1112, 420, 29958, 29890, 898, 29900, 29900, 29945, 29914, 295, 4346, 29918, 1089, 13, 5215, 337, 13, 3166, 19229, 1053, 3789, 13, 13, 5215, 805, 4135, 29918, 566, 17760, 13, 3166, 805, 4135, 29918, 566, 17760, 1053, 501, ...
telegram_bot/bot.py
HikkaV/Neural-conversational-bot
1
93084
from model.seq2seq import Seq2Seq from model.decoding_techniques import BeamSearchDecoder, GreedyDecoder, NucleusDecoder from utils.model_utils import predict_beam, predict_greedy, predict_nucleus, process_sentence import telebot from telebot import types import logging logger = telebot.logger telebot.logger.setLevel(...
[ 1, 515, 1904, 29889, 11762, 29906, 11762, 1053, 25981, 29906, 23718, 13, 3166, 1904, 29889, 7099, 3689, 29918, 371, 6387, 1912, 1053, 1522, 314, 7974, 6185, 6119, 29892, 4122, 7584, 6185, 6119, 29892, 405, 1682, 280, 375, 6185, 6119, 13, ...
01_aat-ebook-full-source-code-20160430/chapter4/bayes-binomial-mcmc.py
UpSea/midProjects
1
101134
import matplotlib.pyplot as plt import numpy as np import pymc3 import scipy.stats as stats plt.style.use("ggplot") # Parameter values for prior and analytic posterior n = 50 z = 10 alpha = 12 beta = 12 alpha_post = 22 beta_post = 52 # How many samples to carry out for MCMC iterations = 100000 # Use PyMC3 to constr...
[ 1, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 12655, 408, 7442, 13, 5215, 282, 962, 29883, 29941, 13, 5215, 4560, 2272, 29889, 16202, 408, 22663, 13, 13, 572, 29873, 29889, 3293, 29889, 1509, 703, 1505, 5317, 1159, 13, 13, ...
utils/files.py
sno2/Payment-Processor
80
171124
<filename>utils/files.py import csv import json def read_csv(*, file): """ Read CSV file as list of dictionaries """ results = [] with open(file) as f: f_csv = csv.DictReader(f) for row in f_csv: results.append(row) return results def write_json(*, file, data): ...
[ 1, 529, 9507, 29958, 13239, 29914, 5325, 29889, 2272, 13, 5215, 11799, 13, 5215, 4390, 13, 13, 13, 1753, 1303, 29918, 7638, 10456, 29892, 934, 1125, 13, 1678, 9995, 13, 1678, 7523, 16874, 934, 408, 1051, 310, 21503, 4314, 13, 1678, 99...
src/rogerthat/utils/base65.py
goubertbrent/oca-backend
0
78559
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 7646, 13939, 9923, 1974, 405, 29963, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29...
slaid/classifiers/__init__.py
mdrio/slaid
0
94829
from slaid.classifiers.base import *
[ 1, 515, 8370, 333, 29889, 1990, 14903, 29889, 3188, 1053, 334, 13, 2 ]
ArtGAN/data/ingest_stl10.py
rh01/caffe-model-for-category-artgan
304
29815
from configargparse import ArgParser from PIL import Image import logging import numpy as np import os def transform_and_save(img_arr, output_filename): """ Takes an image and optionally transforms it and then writes it out to output_filename """ img = Image.fromarray(img_arr) img.save(output_file...
[ 1, 515, 2295, 1191, 5510, 1053, 11842, 11726, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 12183, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 13, 13, 1753, 4327, 29918, 392, 29918, 7620, 29898, 2492, 29918, 2749, 29892, 1962, 29918, ...
stripe/version.py
jameshageman-stripe/stripe-python
7
163348
VERSION = '2.17.0'
[ 1, 478, 1001, 13381, 353, 525, 29906, 29889, 29896, 29955, 29889, 29900, 29915, 13, 2 ]
video/management/commands/loadvideos.py
chandojo/climbbeta
1
148267
<reponame>chandojo/climbbeta<filename>video/management/commands/loadvideos.py from django.core import management from django.core.management.base import BaseCommand, CommandError from django.core.management.commands import loaddata from datetime import date class Command(BaseCommand): help = "Uploads video fixture...
[ 1, 529, 276, 1112, 420, 29958, 305, 1743, 2212, 29914, 695, 326, 1327, 1187, 29966, 9507, 29958, 9641, 29914, 21895, 29914, 26381, 29914, 1359, 29894, 7958, 29889, 2272, 13, 3166, 9557, 29889, 3221, 1053, 10643, 13, 3166, 9557, 29889, 322...
density-based/train.py
ramonpeter/UnbinnedMeasurements
0
13154
import tensorflow as tf import pandas as pd import numpy as np import sys import time from cflow import ConditionalFlow from MoINN.modules.subnetworks import DenseSubNet from utils import train_density_estimation, plot_loss, plot_tau_ratio # import data tau1_gen = np.reshape(np.load("../data/tau1s_Pythia_gen.npy"), ...
[ 1, 1053, 26110, 408, 15886, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 10876, 13, 5215, 931, 13, 13, 3166, 274, 1731, 1053, 11790, 3245, 17907, 13, 3166, 4546, 1177, 29940, 29889, 7576, 29889, 1491, 11618, 29879,...
lesson_7/Pro.py
windn19/Python_Developer
1
112778
<reponame>windn19/Python_Developer from docx.shared import Cm # импорт из библиотеки класса для обработки изображений from docxtpl import DocxTemplate, InlineImage # импорт из библиотеки классов генерации doc документов из шаблонов и включения в них изображений import csv # подключение библиотеки для работы с csv imp...
[ 1, 529, 276, 1112, 420, 29958, 14800, 29876, 29896, 29929, 29914, 11980, 29918, 21956, 261, 13, 3166, 1574, 29916, 29889, 12366, 1053, 315, 29885, 29871, 396, 8933, 1268, 8113, 1866, 5660, 5116, 20390, 717, 9955, 13637, 3807, 9111, 1782, ...
project_underhill/core/security.py
ErikSeguinte/project_underhill
0
67651
from passlib.context import CryptContext import secrets pwd_context = CryptContext(schemes=["argon2"], deprecated="auto") def get_random_string(): return secrets.token_urlsafe(5)
[ 1, 515, 1209, 1982, 29889, 4703, 1053, 315, 4641, 2677, 13, 5215, 22183, 1372, 13, 13, 29886, 9970, 29918, 4703, 353, 315, 4641, 2677, 29898, 816, 13826, 29922, 3366, 1191, 265, 29906, 12436, 18164, 543, 6921, 1159, 13, 13, 13, 1753, ...
EDScoutCore/JournalInterface.py
bal6765/ed-scout
0
5394
<gh_stars>0 from inspect import signature import json import time import os import glob import logging from pathlib import Path from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver from watchdog.events import PatternMatchingEventHandler from EDScoutCore.FileSystemUp...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 16096, 1053, 12608, 30004, 13, 5215, 4390, 30004, 13, 5215, 931, 30004, 13, 5215, 2897, 30004, 13, 5215, 13149, 30004, 13, 5215, 12183, 30004, 13, 30004, 13, 3166, 2224, 1982, 105...
wisdem/test/test_optimization_drivers/test_dakota_driver.py
johnjasa/WISDEM
81
10791
import unittest import numpy as np from openmdao.utils.assert_utils import assert_near_equal from wisdem.optimization_drivers.dakota_driver import DakotaOptimizer try: import dakota except ImportError: dakota = None @unittest.skipIf(dakota is None, "only run if Dakota is installed.") class Te...
[ 1, 1053, 443, 27958, 30004, 13, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 30004, 13, 3166, 1722, 29885, 1388, 29877, 29889, 13239, 29889, 9294, 29918, 13239, 1053, 4974, 29918, 28502, 29918, 11745, 30004, 13, 3166, 22573, 2310, 29889, ...
main.py
jonodrew/matchex
0
458
from __future__ import division from timeit import default_timer as timer import csv import numpy as np import itertools from munkres import Munkres, print_matrix, make_cost_matrix import sys from classes import * from functions import * from math import sqrt import Tkinter as tk import tkFileDialog as filedialog root...
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8542, 13, 3166, 931, 277, 1053, 2322, 29918, 20404, 408, 12237, 13, 5215, 11799, 13, 5215, 12655, 408, 7442, 13, 5215, 4256, 8504, 13, 3166, 286, 2960, 690, 1053, 341, 2960, 690, 29892, 1596, 299...
day3/p1.py
pwicks86/adventofcode2015
0
5223
from collections import defaultdict f = open("input.txt") d = f.read() houses = defaultdict(int,{(0,0):1}) cur = [0,0] for c in d: if c == "<": cur[0] -= 1 if c == ">": cur[0] += 1 if c == "v": cur[1] += 1 if c == "^": cur[1] -= 1 houses[tuple(cur)]+=1 print(len(hou...
[ 1, 515, 16250, 1053, 2322, 8977, 13, 29888, 353, 1722, 703, 2080, 29889, 3945, 1159, 13, 29881, 353, 285, 29889, 949, 580, 13, 29882, 23676, 353, 2322, 8977, 29898, 524, 29892, 8001, 29900, 29892, 29900, 1125, 29896, 1800, 13, 2764, 353...