hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71483250f4208d1d6c47fbd42c29ab271f6db11 | 24 | py | Python | tests/applicationinsights_tests/exception_tests/__init__.py | Rebeccalau/ApplicationInsights-Python | cc91fede2d6d6c48acaa5687aa13ca491a17025a | [
"MIT"
] | 89 | 2015-05-06T22:02:17.000Z | 2019-04-22T14:50:33.000Z | tests/applicationinsights_tests/exception_tests/__init__.py | Rebeccalau/ApplicationInsights-Python | cc91fede2d6d6c48acaa5687aa13ca491a17025a | [
"MIT"
] | 115 | 2015-04-29T17:44:52.000Z | 2019-04-25T21:39:02.000Z | tests/applicationinsights_tests/exception_tests/__init__.py | Rebeccalau/ApplicationInsights-Python | cc91fede2d6d6c48acaa5687aa13ca491a17025a | [
"MIT"
] | 59 | 2015-04-19T13:34:52.000Z | 2019-04-25T21:04:02.000Z | from . import TestEnable | 24 | 24 | 0.833333 | from . import TestEnable | true | true |
f71483376b99d2de664991b4779d8b43020d054e | 888 | py | Python | from_3b1b/on_hold/eop/reusables/eop_helpers.py | Tarang74/manim | df34d6fc0470916cfba63534b023addb69cdec9a | [
"MIT"
] | 1 | 2021-03-26T08:23:35.000Z | 2021-03-26T08:23:35.000Z | from_3b1b/on_hold/eop/reusables/eop_helpers.py | Tarang74/manim | df34d6fc0470916cfba63534b023addb69cdec9a | [
"MIT"
] | null | null | null | from_3b1b/on_hold/eop/reusables/eop_helpers.py | Tarang74/manim | df34d6fc0470916cfba63534b023addb69cdec9a | [
"MIT"
] | null | null | null | from utils.color import *
from active_projects.eop.reusables.eop_constants import *
def binary(i):
# returns an array of 0s and 1s
if i == 0:
return []
j = i
binary_array = []
while j > 0:
jj = j / 2
if jj > 0:
binary_array.append(j % 2)
else:
... | 21.658537 | 72 | 0.574324 | from utils.color import *
from active_projects.eop.reusables.eop_constants import *
def binary(i):
if i == 0:
return []
j = i
binary_array = []
while j > 0:
jj = j / 2
if jj > 0:
binary_array.append(j % 2)
else:
binary_array.append(1)
... | true | true |
f714837c409dd8d89eb62bb58f903782ce4acb43 | 5,005 | py | Python | infomercial/exp/softmeta_bandit.py | CoAxLab/infomercial | fa5d1c1e5c1351735dda2961a2a94f71cd17e270 | [
"MIT"
] | 4 | 2019-11-14T03:13:25.000Z | 2021-01-04T17:30:23.000Z | infomercial/exp/softmeta_bandit.py | CoAxLab/infomercial | fa5d1c1e5c1351735dda2961a2a94f71cd17e270 | [
"MIT"
] | null | null | null | infomercial/exp/softmeta_bandit.py | CoAxLab/infomercial | fa5d1c1e5c1351735dda2961a2a94f71cd17e270 | [
"MIT"
] | null | null | null | import os
import fire
import gym
import numpy as np
from scipy.special import softmax
from noboard.csv import SummaryWriter
from copy import deepcopy
from scipy.stats import entropy
from collections import OrderedDict
from infomercial.distance import kl
from infomercial.memory import DiscreteDistribution
from infom... | 29.441176 | 78 | 0.624575 | import os
import fire
import gym
import numpy as np
from scipy.special import softmax
from noboard.csv import SummaryWriter
from copy import deepcopy
from scipy.stats import entropy
from collections import OrderedDict
from infomercial.distance import kl
from infomercial.memory import DiscreteDistribution
from infom... | true | true |
f71483e95b29a8c96562e9039fa444d6ed47f2af | 680 | py | Python | powerdnsadmin/default_config.py | hivelocity/PowerDNS-Admin | 0c9ccf0a7e75817d77fcbfabba58ad2c66c04afa | [
"MIT"
] | null | null | null | powerdnsadmin/default_config.py | hivelocity/PowerDNS-Admin | 0c9ccf0a7e75817d77fcbfabba58ad2c66c04afa | [
"MIT"
] | null | null | null | powerdnsadmin/default_config.py | hivelocity/PowerDNS-Admin | 0c9ccf0a7e75817d77fcbfabba58ad2c66c04afa | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.abspath(os.path.dirname(__file__)))
### BASIC APP CONFIG
SALT = '$2b$12$yLUMTIfl21FKJQpTkRQXCu'
SECRET_KEY = 'e951e5a1f4b94151b360f47edf596dd2'
BIND_ADDRESS = '0.0.0.0'
PORT = 9191
HSTS_ENABLED = False
### DATABASE CONFIG
SQLA_DB_USER = 'pdns'
#SQLA_DB_PASSWORD = 'changeme'... | 26.153846 | 105 | 0.744118 | import os
basedir = os.path.abspath(os.path.abspath(os.path.dirname(__file__)))
u'
SECRET_KEY = 'e951e5a1f4b94151b360f47edf596dd2'
BIND_ADDRESS = '0.0.0.0'
PORT = 9191
HSTS_ENABLED = False
T = '10.42.42.204'
SQLA_DB_NAME = 'pdns'
SQLALCHEMY_TRACK_MODIFICATIONS = True
| true | true |
f714845eb007f7f56466665f162e3ab47ac7470a | 23,375 | py | Python | tests/test_chargen.py | jderam/hyperborea3 | c9a7aced16793f501f9befae15a47b07a8451edc | [
"MIT"
] | 2 | 2022-01-07T22:53:19.000Z | 2022-02-01T07:46:13.000Z | tests/test_chargen.py | jderam/hyperborea-tools | c9a7aced16793f501f9befae15a47b07a8451edc | [
"MIT"
] | 60 | 2021-12-29T04:57:27.000Z | 2022-02-12T09:50:55.000Z | tests/test_chargen.py | jderam/hyperborea-tools | c9a7aced16793f501f9befae15a47b07a8451edc | [
"MIT"
] | null | null | null | import pytest
from hyperborea3.chargen import (
DBPATH,
ac_to_aac,
calculate_ac,
class_id_to_name,
get_alignment,
get_attr,
get_attr_mod,
get_caster_schools,
get_class_id_map,
get_class_level_data,
get_combat_matrix,
get_deity,
get_favoured_weapons,
get_gender,
... | 30.47588 | 88 | 0.515722 | import pytest
from hyperborea3.chargen import (
DBPATH,
ac_to_aac,
calculate_ac,
class_id_to_name,
get_alignment,
get_attr,
get_attr_mod,
get_caster_schools,
get_class_id_map,
get_class_level_data,
get_combat_matrix,
get_deity,
get_favoured_weapons,
get_gender,
... | true | true |
f71484d9b44030ff88de3d344a897e3b616df745 | 3,140 | py | Python | 4_forthproject/forthproject/settings.py | merry-hyelyn/LIKE_LION | 26d6642a88d5c075447c60d43a70a7d0f082fb07 | [
"MIT"
] | null | null | null | 4_forthproject/forthproject/settings.py | merry-hyelyn/LIKE_LION | 26d6642a88d5c075447c60d43a70a7d0f082fb07 | [
"MIT"
] | null | null | null | 4_forthproject/forthproject/settings.py | merry-hyelyn/LIKE_LION | 26d6642a88d5c075447c60d43a70a7d0f082fb07 | [
"MIT"
] | null | null | null | """
Django settings for forthproject project.
Generated by 'django-admin startproject' using Django 2.1.8.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import ... | 25.737705 | 91 | 0.698726 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '8sjx*ixqizq%)vswdwn82p(w8en&cknd@dey%8h7ex@e&bqx_4'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f71485e72b788fa273c442546c715e7aa086321c | 8,018 | py | Python | gasex/diff.py | dnicholson/gasex-python | 53b8c3ff4e64e724d8883bdef299d465621b124f | [
"MIT"
] | 1 | 2019-04-06T17:52:30.000Z | 2019-04-06T17:52:30.000Z | gasex/diff.py | dnicholson/gasex-python | 53b8c3ff4e64e724d8883bdef299d465621b124f | [
"MIT"
] | null | null | null | gasex/diff.py | dnicholson/gasex-python | 53b8c3ff4e64e724d8883bdef299d465621b124f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
% Diffusion coeff and Schmidt number for gases in fresh/sea water
%=========================================================================
% Modified by D. Nicholson from MATLAB gas_diffusion Version 2.0 16 July 2013
% Author: Roberta C. Hamme (University of... | 43.814208 | 99 | 0.607383 |
from __future__ import division
import numpy as np
from numpy.polynomial.polynomial import polyval
from ._utilities import match_args_return
from gasex.phys import R as R
from gasex.phys import visc as visc
GAS_LIST = ('HE','NE','AR','KR','XE','N2','O2','CH4','N2','CO2')
@match_args_return
def diff(SP,pt,*,gas=... | true | true |
f7148669ff553acc8e2aab92e20c57cfaa89f4d4 | 952 | py | Python | testing/functional_tests/test_convert_to_onnx.py | cakester/ivadomed | 321a91c7e3c82e6296764895e39695b04a80c8af | [
"MIT"
] | null | null | null | testing/functional_tests/test_convert_to_onnx.py | cakester/ivadomed | 321a91c7e3c82e6296764895e39695b04a80c8af | [
"MIT"
] | 6 | 2021-03-24T16:23:29.000Z | 2021-04-08T15:22:53.000Z | testing/functional_tests/test_convert_to_onnx.py | cakester/ivadomed | 321a91c7e3c82e6296764895e39695b04a80c8af | [
"MIT"
] | null | null | null | import logging
import pytest
import os
from functional_tests.t_utils import remove_tmp_dir, create_tmp_dir, __data_testing_dir__
from ivadomed.scripts import convert_to_onnx
from ivadomed.utils import ArgParseException
logger = logging.getLogger(__name__)
__model_path__ = os.path.join(__data_testing_dir__, 'spinegener... | 28.848485 | 89 | 0.765756 | import logging
import pytest
import os
from functional_tests.t_utils import remove_tmp_dir, create_tmp_dir, __data_testing_dir__
from ivadomed.scripts import convert_to_onnx
from ivadomed.utils import ArgParseException
logger = logging.getLogger(__name__)
__model_path__ = os.path.join(__data_testing_dir__, 'spinegener... | true | true |
f714889560de33dc5cf5c279055a50f15365c010 | 6,460 | py | Python | courses/machine_learning/deepdive/05_artandscience/simplernn/trainer/model.py | alixhami/training-data-analyst | 826a9270e784a64ea3bd62c34689518280df71a8 | [
"Apache-2.0"
] | 1 | 2019-02-12T21:40:03.000Z | 2019-02-12T21:40:03.000Z | courses/machine_learning/deepdive/05_artandscience/simplernn/trainer/model.py | alixhami/training-data-analyst | 826a9270e784a64ea3bd62c34689518280df71a8 | [
"Apache-2.0"
] | 11 | 2020-01-28T22:39:44.000Z | 2022-03-11T23:42:53.000Z | courses/machine_learning/deepdive/05_artandscience/simplernn/trainer/model.py | vega42/GoogleCloudPlatform-training-data-analyst | 3eb60cb6c8b55fd7f38414c1082da36b8e62558e | [
"Apache-2.0"
] | 1 | 2021-01-15T10:20:27.000Z | 2021-01-15T10:20:27.000Z | #!/usr/bin/env python3
# Copyright 2017 Google Inc. 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.org/licenses/LICENSE-2.0
#
# Unless requir... | 39.151515 | 112 | 0.657276 |
import tensorflow as tf
import tensorflow.contrib.metrics as metrics
import tensorflow.contrib.rnn as rnn
tf.logging.set_verbosity(tf.logging.INFO)
SEQ_LEN = 10
DEFAULTS = [[0.0] for x in range(0, SEQ_LEN)]
BATCH_SIZE = 20
TIMESERIES_INPUT_LAYER = 'rawdata'
TIMESERIES_COL = '{}_input'.format(TIMESERIE... | true | true |
f71488cdf51ba686efdcf99b240b487d5d66ed67 | 16,474 | py | Python | env/lib/python2.7/site-packages/pip/cmdoptions.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 168 | 2015-05-29T13:56:01.000Z | 2022-02-17T07:38:17.000Z | env/lib/python2.7/site-packages/pip/cmdoptions.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 3,243 | 2017-02-07T15:30:01.000Z | 2022-03-31T16:42:19.000Z | env/lib/python2.7/site-packages/pip/cmdoptions.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... | 25.984227 | 79 | 0.622253 | from __future__ import absolute_import
from functools import partial
from optparse import OptionGroup, SUPPRESS_HELP, Option
import warnings
from pip.index import (
FormatControl, fmt_ctl_handle_mutual_exclude, fmt_ctl_no_binary,
fmt_ctl_no_use_wheel)
from pip.models import PyPI
from pip.locations import USER... | true | true |
f71489253e48c8415077de99962ccba5eff495e5 | 962 | py | Python | xmrig_exporter/exporter.py | leonardochaia/xmrig_exporter | 56cb4a6f4b4a4df3f972fe20478269f79d6da34f | [
"MIT"
] | 2 | 2019-09-19T00:15:20.000Z | 2021-06-25T19:35:03.000Z | xmrig_exporter/exporter.py | leonardochaia/xmrig_exporter | 56cb4a6f4b4a4df3f972fe20478269f79d6da34f | [
"MIT"
] | 1 | 2019-09-19T02:29:34.000Z | 2019-09-19T02:41:45.000Z | xmrig_exporter/exporter.py | leonardochaia/xmrig_exporter | 56cb4a6f4b4a4df3f972fe20478269f79d6da34f | [
"MIT"
] | 2 | 2019-09-19T01:36:19.000Z | 2021-04-13T01:29:13.000Z | import argparse
import http.server
import logging
import sys
import prometheus_client
import xmrig_exporter
def main():
parser = argparse.ArgumentParser("Xmrig Exporter")
parser.add_argument("--port", type=int, default=9189)
parser.add_argument("--bind_address", default="0.0.0.0")
parser.add_argume... | 25.315789 | 73 | 0.702703 | import argparse
import http.server
import logging
import sys
import prometheus_client
import xmrig_exporter
def main():
parser = argparse.ArgumentParser("Xmrig Exporter")
parser.add_argument("--port", type=int, default=9189)
parser.add_argument("--bind_address", default="0.0.0.0")
parser.add_argume... | true | true |
f714898b0c1aae3362b96ae223d64cae5cb39b1a | 442 | py | Python | run_search_goods.py | nikolay-py/product_optimizer | 3d7da484984e63791849ce8a12b285a1ba2daacf | [
"MIT"
] | null | null | null | run_search_goods.py | nikolay-py/product_optimizer | 3d7da484984e63791849ce8a12b285a1ba2daacf | [
"MIT"
] | 1 | 2021-07-05T13:42:19.000Z | 2021-07-05T14:14:44.000Z | run_search_goods.py | nikolay-py/product_optimizer | 3d7da484984e63791849ce8a12b285a1ba2daacf | [
"MIT"
] | null | null | null | """A utility for experimenting with searching."""
from project.parsers.crud import get_goods
from project.parsers.search_goods import db
from project.recipes.models import Recipe
if __name__ == "__main__":
recipe = db.query(Recipe).filter(Recipe.id == 2).first().product_list
goods_list = get_goods(recipe,10)
... | 34 | 73 | 0.649321 | from project.parsers.crud import get_goods
from project.parsers.search_goods import db
from project.recipes.models import Recipe
if __name__ == "__main__":
recipe = db.query(Recipe).filter(Recipe.id == 2).first().product_list
goods_list = get_goods(recipe,10)
for inhidient in goods_list:
print('--... | true | true |
f71489c3ef52e026137535b36258928677e4ed4f | 1,562 | py | Python | plateo/parsers/file_parsers.py | Edinburgh-Genome-Foundry/plateo | c9a608658325f3c507788d9b966a3f3c8e516bc5 | [
"MIT"
] | 22 | 2018-01-29T21:34:25.000Z | 2021-12-14T15:31:49.000Z | plateo/parsers/file_parsers.py | Edinburgh-Genome-Foundry/plateo | c9a608658325f3c507788d9b966a3f3c8e516bc5 | [
"MIT"
] | 3 | 2017-09-20T16:08:45.000Z | 2021-05-28T17:45:14.000Z | plateo/parsers/file_parsers.py | Edinburgh-Genome-Foundry/plateo | c9a608658325f3c507788d9b966a3f3c8e516bc5 | [
"MIT"
] | 5 | 2018-09-18T08:53:37.000Z | 2021-04-28T08:44:38.000Z | """Misc. file parsers that are useful for other parsers"""
from xml.sax import saxutils, parse, parseString
class ExcelHandler(saxutils.handler.ContentHandler):
"""
This class is taken from the Python Cookbook so I guess the copyright
goes to them.
Memo: changed the handler from DefaultHandler to Con... | 28.925926 | 75 | 0.596671 | from xml.sax import saxutils, parse, parseString
class ExcelHandler(saxutils.handler.ContentHandler):
def __init__(self):
self.chars = []
self.cells = []
self.rows = []
self.tables = []
def characters(self, content):
self.chars.append(content)
def startElement(sel... | true | true |
f71489efe090002bbbd4dcf98ceba635d27bfa14 | 7,361 | py | Python | rlcard/games/leducholdem/game.py | NiccoloSacchi/rlcard | 046129e8616b12e25652957869a94ab5fd838ae1 | [
"MIT"
] | null | null | null | rlcard/games/leducholdem/game.py | NiccoloSacchi/rlcard | 046129e8616b12e25652957869a94ab5fd838ae1 | [
"MIT"
] | null | null | null | rlcard/games/leducholdem/game.py | NiccoloSacchi/rlcard | 046129e8616b12e25652957869a94ab5fd838ae1 | [
"MIT"
] | 1 | 2020-11-20T16:38:37.000Z | 2020-11-20T16:38:37.000Z | import numpy as np
from copy import copy
from rlcard.games.leducholdem.dealer import LeducholdemDealer as Dealer
from rlcard.games.leducholdem.player import LeducholdemPlayer as Player
from rlcard.games.leducholdem.judger import LeducholdemJudger as Judger
from rlcard.games.leducholdem.round import LeducholdemRound as... | 34.237209 | 141 | 0.603586 | import numpy as np
from copy import copy
from rlcard.games.leducholdem.dealer import LeducholdemDealer as Dealer
from rlcard.games.leducholdem.player import LeducholdemPlayer as Player
from rlcard.games.leducholdem.judger import LeducholdemJudger as Judger
from rlcard.games.leducholdem.round import LeducholdemRound as... | true | true |
f7148a75a4e4a85ae3bd6f491ecb0aa85bbc5afc | 471 | py | Python | Python/Functions_base/Functions/replace_ElecNaming.py | DanielHuji-RB/RB-article | e5a9ba30edfb030db1cd3bcf562c6abff3f9d48e | [
"MIT"
] | null | null | null | Python/Functions_base/Functions/replace_ElecNaming.py | DanielHuji-RB/RB-article | e5a9ba30edfb030db1cd3bcf562c6abff3f9d48e | [
"MIT"
] | null | null | null | Python/Functions_base/Functions/replace_ElecNaming.py | DanielHuji-RB/RB-article | e5a9ba30edfb030db1cd3bcf562c6abff3f9d48e | [
"MIT"
] | null | null | null | #Daniel Sand
import pandas as pd
import numpy as np
fileName='/Tscores.csv'
newFileName='/Tscores_v3.csv'
df=pd.read_csv(fileName, sep=',')
#6 differnt electordes
oldFormat=['0-1','0-2','0-3','2-Jan','3-Jan','3-Feb']
newFormat=['0_1','0_2','0_3','2_1','3_1','3_2']
for iCont in range(0, len(oldFormat)):
currEl... | 22.428571 | 53 | 0.696391 |
import pandas as pd
import numpy as np
fileName='/Tscores.csv'
newFileName='/Tscores_v3.csv'
df=pd.read_csv(fileName, sep=',')
oldFormat=['0-1','0-2','0-3','2-Jan','3-Jan','3-Feb']
newFormat=['0_1','0_2','0_3','2_1','3_1','3_2']
for iCont in range(0, len(oldFormat)):
currElec_old = oldFormat[iCont]
curr... | true | true |
f7148acd3d12984fc7698af4459254aa88540a51 | 188 | py | Python | setup.py | jjc2718/mpmp | 9960d8d3e20e4fc9319e5420e083fece5bfb3d9e | [
"BSD-3-Clause"
] | 1 | 2021-11-02T05:47:38.000Z | 2021-11-02T05:47:38.000Z | setup.py | jjc2718/mpmp | 9960d8d3e20e4fc9319e5420e083fece5bfb3d9e | [
"BSD-3-Clause"
] | 63 | 2020-12-03T23:55:55.000Z | 2022-03-29T17:55:29.000Z | setup.py | jjc2718/mpmp | 9960d8d3e20e4fc9319e5420e083fece5bfb3d9e | [
"BSD-3-Clause"
] | 3 | 2020-12-01T18:50:00.000Z | 2022-02-18T12:32:38.000Z | from setuptools import setup
setup(
name='mpmp',
author='Jake Crawford',
version='0.0.1',
description='Multimodal Pan-cancer Mutation Prediction',
packages=['mpmp']
)
| 18.8 | 60 | 0.670213 | from setuptools import setup
setup(
name='mpmp',
author='Jake Crawford',
version='0.0.1',
description='Multimodal Pan-cancer Mutation Prediction',
packages=['mpmp']
)
| true | true |
f7148c067979d0d62792963a826a42a813df0ab1 | 8,199 | py | Python | ludwig/features/image_feature.py | ThinkBigAnalytics/ludwig | 0a3159af4cc91f57251f3dec0cdb863c7003cf00 | [
"Apache-2.0"
] | 1 | 2019-07-31T19:11:02.000Z | 2019-07-31T19:11:02.000Z | ludwig/features/image_feature.py | ThinkBigAnalytics/ludwig | 0a3159af4cc91f57251f3dec0cdb863c7003cf00 | [
"Apache-2.0"
] | null | null | null | ludwig/features/image_feature.py | ThinkBigAnalytics/ludwig | 0a3159af4cc91f57251f3dec0cdb863c7003cf00 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | 32.796 | 80 | 0.558971 |
import logging
import os
import h5py
import numpy as np
import tensorflow as tf
from skimage.io import imread
from ludwig.constants import *
from ludwig.features.base_feature import BaseFeature
from ludwig.features.base_feature import InputFeature
from ludwig.models.modules.image_encoders import ResNe... | true | true |
f7148ccd4e901a2e9e3c5c5b644f2f81ee5e045c | 133,646 | py | Python | tensorflow/python/keras/layers/convolutional.py | devinlife/tensorflow | 1445444c15a396410f25ae91b7d1c19d724e2afc | [
"Apache-2.0"
] | 8 | 2020-07-29T18:50:45.000Z | 2021-07-25T07:06:43.000Z | tensorflow/python/keras/layers/convolutional.py | devinlife/tensorflow | 1445444c15a396410f25ae91b7d1c19d724e2afc | [
"Apache-2.0"
] | 203 | 2019-06-14T23:53:10.000Z | 2022-02-10T02:27:23.000Z | tensorflow/python/keras/layers/convolutional.py | devinlife/tensorflow | 1445444c15a396410f25ae91b7d1c19d724e2afc | [
"Apache-2.0"
] | 11 | 2020-05-31T13:14:56.000Z | 2021-12-14T04:39:25.000Z | # 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.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.535638 | 104 | 0.657221 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from tensorflow.python.framework import tensor_shape
from tensorflow.python.keras import activations
from tensorflow.python.keras import backend
from t... | true | true |
f7148d6111bc6f731ff2f47e5c14db68aaca4f46 | 590 | py | Python | src/aoc/__init__.py | CreatingNull/AoC-2021 | ee0aec7aa2f4d7cb2d62838d39f8c74edae8cc96 | [
"MIT"
] | null | null | null | src/aoc/__init__.py | CreatingNull/AoC-2021 | ee0aec7aa2f4d7cb2d62838d39f8c74edae8cc96 | [
"MIT"
] | null | null | null | src/aoc/__init__.py | CreatingNull/AoC-2021 | ee0aec7aa2f4d7cb2d62838d39f8c74edae8cc96 | [
"MIT"
] | null | null | null | """Root package for the challenge.
Contains generic functionality not specific to days.
"""
import logging
import sys
from functools import partial
from pathlib import Path
ROOT_PATH = Path(Path(__file__).parents[1])
open_utf8 = partial(open, encoding="UTF-8") # Open with explict encoding
# Configuring the global ... | 25.652174 | 77 | 0.766102 | import logging
import sys
from functools import partial
from pathlib import Path
ROOT_PATH = Path(Path(__file__).parents[1])
open_utf8 = partial(open, encoding="UTF-8")
log = logging.getLogger()
log.setLevel(logging.INFO)
__handler = logging.StreamHandler(sys.stdout)
__handler.setLevel(logging.DEBUG)
__handler.se... | true | true |
f7148e83286d37d30f28041686db57b3c928f8c8 | 5,117 | py | Python | command/download.py | aungthuphyo21/aungthuphyo22 | 462c515e7dc987aa877dd8e38ccd1e3e6abeab3d | [
"MIT"
] | null | null | null | command/download.py | aungthuphyo21/aungthuphyo22 | 462c515e7dc987aa877dd8e38ccd1e3e6abeab3d | [
"MIT"
] | null | null | null | command/download.py | aungthuphyo21/aungthuphyo22 | 462c515e7dc987aa877dd8e38ccd1e3e6abeab3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import argparse
import subprocess
from bddown_core import Pan
from util import convert_none, parse_url, add_http, logger
from config import global_config
def download_command(filename, savedir, link, cookies, limit=None, output_dir=Non... | 37.07971 | 117 | 0.577682 |
from __future__ import print_function
import os
import sys
import argparse
import subprocess
from bddown_core import Pan
from util import convert_none, parse_url, add_http, logger
from config import global_config
def download_command(filename, savedir, link, cookies, limit=None, output_dir=None):
reload(sys)
... | true | true |
f7148f1f8278d6d236a00eec569bd331d09b34c0 | 1,299 | py | Python | main.py | TakeItIsi/Snakehogs- | 6c92184a564738a1af8bb7e0b9a3bc74689fde49 | [
"MIT"
] | null | null | null | main.py | TakeItIsi/Snakehogs- | 6c92184a564738a1af8bb7e0b9a3bc74689fde49 | [
"MIT"
] | null | null | null | main.py | TakeItIsi/Snakehogs- | 6c92184a564738a1af8bb7e0b9a3bc74689fde49 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
import os
from Controlador.Basic_Controller import Controlador
from Controlador.Menu_Controller import Menu
from Controlador.Versus_Controller import Versus_Controlador
__author__ = "Isidora Ulloa"
__license__ = "GPL"
__version__ = "1.0.0"
__email_... | 34.184211 | 151 | 0.638953 |
import pygame
import os
from Controlador.Basic_Controller import Controlador
from Controlador.Menu_Controller import Menu
from Controlador.Versus_Controller import Versus_Controlador
__author__ = "Isidora Ulloa"
__license__ = "GPL"
__version__ = "1.0.0"
__email__ = "isidora.ulloa@ug.uchile.cl"
pygame.ini... | true | true |
f7148f4a83cab36a038bcd04077b0e24ca251006 | 1,137 | py | Python | migrations/versions/8b25b23d386f_chquery_the_comments_migration.py | macc254/Personal-Blog | 3af6083f78e65636a9cf6caa1a3598b13b3b0134 | [
"Unlicense"
] | null | null | null | migrations/versions/8b25b23d386f_chquery_the_comments_migration.py | macc254/Personal-Blog | 3af6083f78e65636a9cf6caa1a3598b13b3b0134 | [
"Unlicense"
] | null | null | null | migrations/versions/8b25b23d386f_chquery_the_comments_migration.py | macc254/Personal-Blog | 3af6083f78e65636a9cf6caa1a3598b13b3b0134 | [
"Unlicense"
] | null | null | null | """ChQuery the comments Migration
Revision ID: 8b25b23d386f
Revises: a21b8da19c7d
Create Date: 2022-03-12 09:58:47.379065
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8b25b23d386f'
down_revision = 'a21b8da19c7d'
branch_labels = None
depends_on = None
def ... | 32.485714 | 103 | 0.700967 | from alembic import op
import sqlalchemy as sa
revision = '8b25b23d386f'
down_revision = 'a21b8da19c7d'
branch_labels = None
depends_on = None
def upgrade():
oreign_key(None, 'comments', 'blogs', ['blogs_id'], ['id'])
op.drop_column('comments', 'pitch_id')
tch_id'], ['id'])
op.drop_column('comments... | true | true |
f714902580ef72ea76cb338fc2ad31571450e93b | 2,584 | py | Python | openGaussBase/testcase/SYSTEM_CATALOGS&SYSTEM_VIEWS/SYSTEM_VIEW/Opengauss_Function_System_View_Case0044.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SYSTEM_CATALOGS&SYSTEM_VIEWS/SYSTEM_VIEW/Opengauss_Function_System_View_Case0044.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SYSTEM_CATALOGS&SYSTEM_VIEWS/SYSTEM_VIEW/Opengauss_Function_System_View_Case0044.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 36.394366 | 84 | 0.589783 |
import unittest
from testcase.utils.Common import Common
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Logger import Logger
LOG = Logger()
class SystemView(unittest.TestCase):
def setUp(self):
LOG.info('----------------this is setup-----------------------')
LOG.info(
... | true | true |
f7149050818fa7e7d8741a281c8eedd9cd01f51f | 185 | py | Python | tests/resource/test_module.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/resource/test_module.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | tests/resource/test_module.py | asyncee/pycamunda | f4834d224ff99fcf80874efeaedf68a8a2efa926 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def test_all_contains_only_valid_names():
import pycamunda.resource
for name in pycamunda.resource.__all__:
getattr(pycamunda.resource, name)
| 20.555556 | 43 | 0.708108 |
def test_all_contains_only_valid_names():
import pycamunda.resource
for name in pycamunda.resource.__all__:
getattr(pycamunda.resource, name)
| true | true |
f71491334e653edf6dda365969aee2cd5e3794d8 | 531 | py | Python | ex14.py | YunMeMeThaw/python_exercises | 151d5d3695d578059611ac09c94b3677442197d7 | [
"MIT"
] | null | null | null | ex14.py | YunMeMeThaw/python_exercises | 151d5d3695d578059611ac09c94b3677442197d7 | [
"MIT"
] | null | null | null | ex14.py | YunMeMeThaw/python_exercises | 151d5d3695d578059611ac09c94b3677442197d7 | [
"MIT"
] | null | null | null | from sys import argv
script, user_name = argv
prompt = '> '
print("Hi %s, I'm the %s script." % (user_name, script))
print("I'd like to ask you a few questions.")
print("Do you like me %s?" % user_name)
likes = input(prompt)
print("Where do you live %s?" % user_name)
lives = input(prompt)
print("What kind of computer d... | 31.235294 | 56 | 0.6629 | from sys import argv
script, user_name = argv
prompt = '> '
print("Hi %s, I'm the %s script." % (user_name, script))
print("I'd like to ask you a few questions.")
print("Do you like me %s?" % user_name)
likes = input(prompt)
print("Where do you live %s?" % user_name)
lives = input(prompt)
print("What kind of computer d... | true | true |
f714924a2eb8a90be404ca381f44409a550c4985 | 8,049 | py | Python | python/mxnet/base.py | ChidanandKumarKS/mxnet | 1ed8b19849046bce92fd3d4a390b2adc405b584a | [
"Apache-2.0"
] | 1 | 2018-09-08T05:58:17.000Z | 2018-09-08T05:58:17.000Z | python/mxnet/base.py | ChidanandKumarKS/mxnet | 1ed8b19849046bce92fd3d4a390b2adc405b584a | [
"Apache-2.0"
] | null | null | null | python/mxnet/base.py | ChidanandKumarKS/mxnet | 1ed8b19849046bce92fd3d4a390b2adc405b584a | [
"Apache-2.0"
] | 1 | 2018-09-04T10:46:25.000Z | 2018-09-04T10:46:25.000Z | # coding: utf-8
# pylint: disable=invalid-name, no-member
"""ctypes library of mxnet and helper functions."""
from __future__ import absolute_import
import sys
import ctypes
import atexit
import warnings
import inspect
import numpy as np
from . import libinfo
warnings.filterwarnings('default', category=DeprecationWarn... | 26.564356 | 78 | 0.60815 |
from __future__ import absolute_import
import sys
import ctypes
import atexit
import warnings
import inspect
import numpy as np
from . import libinfo
warnings.filterwarnings('default', category=DeprecationWarning)
__all__ = ['MXNetError']
if sys.version_info[0] == 3:
string_types = str,
numeric_types = (... | true | true |
f7149262bdb3bfb5bea3bb847f496514f2be6606 | 4,880 | py | Python | scripts/automation.py | Alexey19/Python-UIAutomation-for-Windows | 43d33bed99da66c31bc8471694422352291ae1fb | [
"Apache-2.0"
] | null | null | null | scripts/automation.py | Alexey19/Python-UIAutomation-for-Windows | 43d33bed99da66c31bc8471694422352291ae1fb | [
"Apache-2.0"
] | null | null | null | scripts/automation.py | Alexey19/Python-UIAutomation-for-Windows | 43d33bed99da66c31bc8471694422352291ae1fb | [
"Apache-2.0"
] | null | null | null | #!python3
# -*- coding:utf-8 -*-
import sys
import time
from uiautomation import (Win32API, Logger, ControlFromCursor, GetRootControl, GetFocusedControl,
LogControl, EnumAndLogControlAncestors, EnumAndLogControl, ConsoleColor)
from uiautomation import VERSION
def usage():
Logger.Color... | 40 | 191 | 0.604713 |
import sys
import time
from uiautomation import (Win32API, Logger, ControlFromCursor, GetRootControl, GetFocusedControl,
LogControl, EnumAndLogControlAncestors, EnumAndLogControl, ConsoleColor)
from uiautomation import VERSION
def usage():
Logger.ColorfulWrite("""usage
<Color=Cyan>-... | true | true |
f71492be13cc39a498d67a30628c4004f0f40da6 | 172 | py | Python | 1541/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | 2 | 2020-01-14T07:27:25.000Z | 2020-02-12T07:49:58.000Z | 1541/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | 1 | 2020-01-14T07:29:30.000Z | 2021-11-28T11:29:08.000Z | 1541/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | null | null | null | def sol():
expression = [sum(map(int, x.split("+"))) for x in input().split("-")]
print(expression[0] - sum(expression[1:]))
if __name__ == "__main__":
sol()
| 21.5 | 74 | 0.569767 | def sol():
expression = [sum(map(int, x.split("+"))) for x in input().split("-")]
print(expression[0] - sum(expression[1:]))
if __name__ == "__main__":
sol()
| true | true |
f7149435f8090b28b434d5fbe89c07cf906c1832 | 2,207 | py | Python | arc852/opencv_utils.py | athenian-robotics/common-robotics-python | a2ede8fb3072cf1baa53672f76081aa6bfde397f | [
"MIT"
] | 1 | 2019-02-20T22:59:59.000Z | 2019-02-20T22:59:59.000Z | arc852/opencv_utils.py | athenian-robotics/common-robotics | a2ede8fb3072cf1baa53672f76081aa6bfde397f | [
"MIT"
] | null | null | null | arc852/opencv_utils.py | athenian-robotics/common-robotics | a2ede8fb3072cf1baa53672f76081aa6bfde397f | [
"MIT"
] | 1 | 2020-05-23T09:08:42.000Z | 2020-05-23T09:08:42.000Z | import datetime
import logging
import math
import cv2
RED = (0, 0, 255)
GREEN = (0, 255, 0)
BLUE = (255, 0, 0)
YELLOW = (0, 255, 255)
logger = logging.getLogger(__name__)
def get_moment(contour):
moment1 = cv2.moments(contour)
area = int(moment1["m00"])
x = int(moment1["m10"] / area)
y = int(moment... | 22.752577 | 105 | 0.61169 | import datetime
import logging
import math
import cv2
RED = (0, 0, 255)
GREEN = (0, 255, 0)
BLUE = (255, 0, 0)
YELLOW = (0, 255, 255)
logger = logging.getLogger(__name__)
def get_moment(contour):
moment1 = cv2.moments(contour)
area = int(moment1["m00"])
x = int(moment1["m10"] / area)
y = int(moment... | true | true |
f71494b465a073d5dd94888bf5f7ef9ae0951d01 | 959 | py | Python | tests/v2/test_0879-non-primitive-with-field.py | jpivarski/awkward-1.0 | 49a3ff13ef90b8778a80573211d58c544729eaa5 | [
"BSD-3-Clause"
] | 2 | 2019-09-12T03:07:23.000Z | 2019-09-27T05:32:07.000Z | tests/v2/test_0879-non-primitive-with-field.py | jpivarski/awkward-1.0 | 49a3ff13ef90b8778a80573211d58c544729eaa5 | [
"BSD-3-Clause"
] | 1 | 2019-09-26T17:57:45.000Z | 2019-09-26T17:57:45.000Z | tests/v2/test_0879-non-primitive-with-field.py | jpivarski/awkward-1.0 | 49a3ff13ef90b8778a80573211d58c544729eaa5 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_unknown_type():
array = ak._v2.Array({"x": np.arange(10)})
array = ak._v2.operations.with_field(base=array, what=Non... | 33.068966 | 87 | 0.663191 |
import pytest
import numpy as np
import awkward as ak
def test_unknown_type():
array = ak._v2.Array({"x": np.arange(10)})
array = ak._v2.operations.with_field(base=array, what=None, where="unknown field1")
array = ak._v2.operations.with_field(
base=array, what=[None], where="unknown field2... | true | true |
f714958b669c31b21b54bd0ddb5714e078f4ab0f | 4,265 | py | Python | empower/cli/projects.py | joncnet/empower-runtime | c04d9c7621fdb97dc3bd4ace5cb2d8f7194d540c | [
"Apache-2.0"
] | null | null | null | empower/cli/projects.py | joncnet/empower-runtime | c04d9c7621fdb97dc3bd4ace5cb2d8f7194d540c | [
"Apache-2.0"
] | null | null | null | empower/cli/projects.py | joncnet/empower-runtime | c04d9c7621fdb97dc3bd4ace5cb2d8f7194d540c | [
"Apache-2.0"
] | 2 | 2018-09-24T09:44:19.000Z | 2018-10-12T09:57:36.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2019 Roberto Riggio
#
# 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... | 28.245033 | 73 | 0.605393 |
import uuid
import argparse
import empower.cli.command as command
from empower.core.plmnid import PLMNID
from empower.core.ssid import SSID
def pa_delete_project(args, cmd):
usage = "%s <options>" % command.USAGE.format(cmd)
desc = command.DESCS[cmd]
parser = argparse.ArgumentParser(... | true | true |
f7149618008b2c55257eac69dff2390850219ebb | 1,584 | py | Python | bin/list-keys.py | fenglsuc/PatCit | 6f2585dac156a69ff94f002d387c75bd723529df | [
"MIT"
] | 1 | 2020-04-10T09:18:27.000Z | 2020-04-10T09:18:27.000Z | bin/list-keys.py | fenglsuc/PatCit | 6f2585dac156a69ff94f002d387c75bd723529df | [
"MIT"
] | null | null | null | bin/list-keys.py | fenglsuc/PatCit | 6f2585dac156a69ff94f002d387c75bd723529df | [
"MIT"
] | null | null | null | import json
import lzma
from glob import glob
from pprint import pprint
import click
import smart_open
from tqdm import tqdm
@click.command()
@click.option("--path", help="Path. Wilcard '*' enabled")
@click.option("--tar", default=False, help="True for .xz files")
@click.option(
"--flavor",
default="sm",
... | 29.333333 | 87 | 0.454545 | import json
import lzma
from glob import glob
from pprint import pprint
import click
import smart_open
from tqdm import tqdm
@click.command()
@click.option("--path", help="Path. Wilcard '*' enabled")
@click.option("--tar", default=False, help="True for .xz files")
@click.option(
"--flavor",
default="sm",
... | true | true |
f714961d576161dc58be3cf12b089bd26a129c85 | 1,215 | py | Python | ex3_collatz.py | grace-burke/Grace-Burke-Programming-and-Scripting-GMIT-2018 | b676ebf81388ec3ed46a2d2c9b897ee466598b0b | [
"Apache-2.0"
] | null | null | null | ex3_collatz.py | grace-burke/Grace-Burke-Programming-and-Scripting-GMIT-2018 | b676ebf81388ec3ed46a2d2c9b897ee466598b0b | [
"Apache-2.0"
] | null | null | null | ex3_collatz.py | grace-burke/Grace-Burke-Programming-and-Scripting-GMIT-2018 | b676ebf81388ec3ed46a2d2c9b897ee466598b0b | [
"Apache-2.0"
] | null | null | null | # Grace Burke
# 08/02/2018
# Exercise 3:
# Complete the exercise discussed in the Collatz conjecture video by writing a single Python script that starts with an integer and repeatedly applies the Collatz function (divide by 2 if even, multiply by three and 1 if odd) using a while loop and if statement.
# At each ite... | 48.6 | 263 | 0.719342 |
x = int(input("Please enter an integer: "))
while x > 1:
if x % 2 == 0:
x = x//2
else:
x = 3*x + 1
print (x)
| true | true |
f7149705d601e6aca77921bd8014f22187956ca9 | 13,102 | py | Python | xoa/__init__.py | VACUMM/xoa | c6a0d860528cf33ae15c77fa111f95daab0321c0 | [
"Apache-2.0"
] | 7 | 2021-04-08T08:46:30.000Z | 2022-02-07T11:19:51.000Z | xoa/__init__.py | VACUMM/xoa | c6a0d860528cf33ae15c77fa111f95daab0321c0 | [
"Apache-2.0"
] | 29 | 2021-02-18T10:27:26.000Z | 2022-03-25T08:29:04.000Z | xoa/__init__.py | VACUMM/xoa | c6a0d860528cf33ae15c77fa111f95daab0321c0 | [
"Apache-2.0"
] | 2 | 2020-04-30T17:20:46.000Z | 2022-03-18T14:29:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
xarray-based ocean analysis library
The successor of Vacumm.
"""
# Copyright 2020-2021 Shom
#
# 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... | 24.48972 | 93 | 0.598611 |
import os
import re
import warnings
import platform
import pkg_resources
import appdirs
import configobj
import validate
try:
__version__ = pkg_resources.get_distribution("xoa").version
except Exception:
__version__ = "999"
_RE_OPTION_MATCH = re.compile(r"^(\w+)\W(\w+)$").match
... | true | true |
f7149723918e0c4f1a80671f68d3b10a2ce44e1c | 457 | py | Python | ftm_service/app.py | cansik/FIFATournamentManager | ee86673fe2d754aee35ef277f152fa48e39281d8 | [
"MIT"
] | null | null | null | ftm_service/app.py | cansik/FIFATournamentManager | ee86673fe2d754aee35ef277f152fa48e39281d8 | [
"MIT"
] | null | null | null | ftm_service/app.py | cansik/FIFATournamentManager | ee86673fe2d754aee35ef277f152fa48e39281d8 | [
"MIT"
] | null | null | null | import connexion
import logging
from flask.ext.cors import CORS
from data.data_source import FTMDataSource
data_source = FTMDataSource()
def start_server():
logging.basicConfig(level=logging.INFO)
app = connexion.App(__name__, port=8080, specification_dir='swagger/', server='gevent')
app.add_api('ftm_ser... | 21.761905 | 91 | 0.724289 | import connexion
import logging
from flask.ext.cors import CORS
from data.data_source import FTMDataSource
data_source = FTMDataSource()
def start_server():
logging.basicConfig(level=logging.INFO)
app = connexion.App(__name__, port=8080, specification_dir='swagger/', server='gevent')
app.add_api('ftm_ser... | true | true |
f71498faa11249dfd60ec67c988ac1d9a4251dca | 4,390 | py | Python | homeassistant/components/unifi_direct/device_tracker.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/unifi_direct/device_tracker.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/unifi_direct/device_tracker.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Support for Unifi AP direct access."""
from __future__ import annotations
import json
import logging
from pexpect import exceptions, pxssh
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassista... | 30.915493 | 82 | 0.622551 | from __future__ import annotations
import json
import logging
from pexpect import exceptions, pxssh
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, ... | true | true |
f7149918e61836615e0176df95bfc1ed42c287dc | 821 | py | Python | spider/code/bs_spider01.py | mama2100/knowledge | 5a18a3c243d7411f5135ec680dc5bd95d92be056 | [
"MIT"
] | 881 | 2018-03-20T09:19:14.000Z | 2022-03-24T10:17:33.000Z | spider/code/bs_spider01.py | mama2100/knowledge | 5a18a3c243d7411f5135ec680dc5bd95d92be056 | [
"MIT"
] | null | null | null | spider/code/bs_spider01.py | mama2100/knowledge | 5a18a3c243d7411f5135ec680dc5bd95d92be056 | [
"MIT"
] | 248 | 2018-05-31T01:06:15.000Z | 2022-03-14T06:52:25.000Z |
import urllib3
# 你需要一个PoolManager实例来生成请求,由该实例对象处理与线程池的连接以及
# 线程安全的所有细节,不需要任何人为操作
http = urllib3.PoolManager()
# request()方法创建一个GET请求去获取百度的网页信息,返回的r是一个HttpResponse对象
r = http.request('GET', 'https://www.baidu.com')
# 打印请求的状态
print(r.status)
# 打印请求网页的内容
print(r.data)
'''
Accept: text/html, */*;q=0.8 # 浏览器告诉服务器可以接收的... | 28.310345 | 121 | 0.773447 |
import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'https://www.baidu.com')
print(r.status)
print(r.data)
| true | true |
f71499c7f2f926ce80c69f47e36b2d1191d1b667 | 22,070 | py | Python | nipy/labs/spatial_models/hroi.py | fabianp/nipy | 40e89f3ca7f34df05631623807993026134e6de3 | [
"BSD-3-Clause"
] | 1 | 2020-01-02T01:50:19.000Z | 2020-01-02T01:50:19.000Z | nipy/labs/spatial_models/hroi.py | fabianp/nipy | 40e89f3ca7f34df05631623807993026134e6de3 | [
"BSD-3-Clause"
] | null | null | null | nipy/labs/spatial_models/hroi.py | fabianp/nipy | 40e89f3ca7f34df05631623807993026134e6de3 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
This module contains the specification of 'hierarchical ROI' object,
Which is used in spatial models of the library such as structural analysis
The connection with other classes is not completely satis... | 36.419142 | 79 | 0.561305 |
import numpy as np
from nipy.algorithms.graph.graph import WeightedGraph
from nipy.algorithms.graph.forest import Forest
from nipy.algorithms.graph.field import field_from_coo_matrix_and_data
from .mroi import SubDomains
NINF = - np.inf
def hroi_agglomeration(input_hroi, criterion='size', smin=0):
if criteri... | true | true |
f71499f5deb8f014468d50ba23386afe547af396 | 5,599 | py | Python | utils.py | lgraesser/MCER | 250aa6965064dbc73462eb5edb559bf9ce949b70 | [
"Apache-2.0"
] | null | null | null | utils.py | lgraesser/MCER | 250aa6965064dbc73462eb5edb559bf9ce949b70 | [
"Apache-2.0"
] | null | null | null | utils.py | lgraesser/MCER | 250aa6965064dbc73462eb5edb559bf9ce949b70 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import matplotlib.pyplot as plt
import os
import tensorflow as tf
from sklearn.utils import shuffle
import model
import train
logger = logging.getLogger('utils')
logger.setLevel(logging.INFO)
def get_data_path():
'''Returns the path to the image and annotation data.
Downloads the ... | 37.577181 | 135 | 0.666905 | import json
import logging
import matplotlib.pyplot as plt
import os
import tensorflow as tf
from sklearn.utils import shuffle
import model
import train
logger = logging.getLogger('utils')
logger.setLevel(logging.INFO)
def get_data_path():
annotation_folder = '/data/train_data/annotations/'
if not os.p... | true | true |
f7149a066af83fb2bde594eb67a847e0095f1a45 | 8,345 | py | Python | apischema/conversions/visitor.py | klauer/apischema | 0da9b96b74dabe8704e2dcfca4502aed98500799 | [
"MIT"
] | null | null | null | apischema/conversions/visitor.py | klauer/apischema | 0da9b96b74dabe8704e2dcfca4502aed98500799 | [
"MIT"
] | null | null | null | apischema/conversions/visitor.py | klauer/apischema | 0da9b96b74dabe8704e2dcfca4502aed98500799 | [
"MIT"
] | null | null | null | from contextlib import contextmanager, suppress
from dataclasses import replace
from functools import lru_cache
from types import new_class
from typing import (
Any,
ClassVar,
Collection,
Generic,
Iterable,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
Union,
)
from apischema.co... | 34.341564 | 88 | 0.660036 | from contextlib import contextmanager, suppress
from dataclasses import replace
from functools import lru_cache
from types import new_class
from typing import (
Any,
ClassVar,
Collection,
Generic,
Iterable,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
Union,
)
from apischema.co... | true | true |
f7149a685dddb6fa97224e4564f4831152a7289f | 3,618 | py | Python | outputs/8c5d9918967dd5901fcbadab29308672/chuansong/pipelines.py | louis-xuy/scrapy_helper | 14acdb8c23316cc1d83c2526ce024447cf60ccbf | [
"MIT"
] | 89 | 2018-01-13T06:51:41.000Z | 2021-12-27T05:52:46.000Z | outputs/8c5d9918967dd5901fcbadab29308672/chuansong/pipelines.py | facert/scrapy_helper | 14acdb8c23316cc1d83c2526ce024447cf60ccbf | [
"MIT"
] | 1 | 2021-06-10T23:54:48.000Z | 2021-06-10T23:54:48.000Z | outputs/8c5d9918967dd5901fcbadab29308672/chuansong/pipelines.py | louis-xuy/scrapy_helper | 14acdb8c23316cc1d83c2526ce024447cf60ccbf | [
"MIT"
] | 37 | 2018-01-16T06:24:17.000Z | 2021-12-27T05:52:54.000Z |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
import socket
import scrapy
import hashlib
from scrapy.exceptions import DropItem
from scrapy.pipelines.images import ImagesPipeline
from sc... | 30.923077 | 112 | 0.640409 |
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import json
import socket
import scrapy
import hashlib
from scrapy.exceptions import DropItem
from scrapy.pipelines.images import ImagesPipeline
from scrapy.utils.project import get_project_settings
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM... | true | true |
f7149aa3d4724732c401b0215429d670613bea8e | 2,020 | py | Python | ppa6test.py | linglingltd/peripage-a6-control | 11c9d36e4f6abb091955452b83120f25c5cc5cef | [
"MIT"
] | 9 | 2021-05-15T15:35:34.000Z | 2022-03-09T22:00:40.000Z | ppa6test.py | linglingltd/peripage-a6-control | 11c9d36e4f6abb091955452b83120f25c5cc5cef | [
"MIT"
] | null | null | null | ppa6test.py | linglingltd/peripage-a6-control | 11c9d36e4f6abb091955452b83120f25c5cc5cef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Simple test procedure for manual printing functions of ppa6ctl module
"""
import ppa6ctl as printer
print("Start module ppa6ctl test procedure")
print("Search for a PeriPage printer, this might take some time...")
mac = printer.search()
if not mac:
print("No printer found, stopping tes... | 24.938272 | 75 | 0.736634 |
import ppa6ctl as printer
print("Start module ppa6ctl test procedure")
print("Search for a PeriPage printer, this might take some time...")
mac = printer.search()
if not mac:
print("No printer found, stopping test procedure")
exit()
print("Connecting to: %s" % mac)
if not printer.connect(mac):
print("Conne... | true | true |
f7149bf48e26c827d23132c1ed53812c920506cd | 40,725 | py | Python | apps/users/views.py | MaLei666/oms | 2447ec656ae5b61b9edc93c28a42f487476b5978 | [
"MIT"
] | null | null | null | apps/users/views.py | MaLei666/oms | 2447ec656ae5b61b9edc93c28a42f487476b5978 | [
"MIT"
] | 6 | 2020-03-23T09:21:13.000Z | 2022-03-11T23:49:57.000Z | apps/users/views.py | MaLei666/oms | 2447ec656ae5b61b9edc93c28a42f487476b5978 | [
"MIT"
] | 1 | 2019-10-15T03:06:46.000Z | 2019-10-15T03:06:46.000Z | ######################################
# Django 模块
######################################
from django.shortcuts import render, HttpResponseRedirect, redirect, reverse
from django.views import View
from django.contrib.auth import login, logout, authenticate
from django.http import HttpResponse
from django.contrib.auth.b... | 35.19879 | 119 | 0.520958 | true | true | |
f7149d10c9678284dc5d440d0ecff556d5542556 | 1,631 | py | Python | aspdotnet/datadog_checks/aspdotnet/config_models/instance.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | aspdotnet/datadog_checks/aspdotnet/config_models/instance.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | aspdotnet/datadog_checks/aspdotnet/config_models/instance.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations
from typing import Optional, Sequence
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_c... | 31.365385 | 110 | 0.722869 |
from __future__ import annotations
from typing import Optional, Sequence
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_checks.base.utils.models import validation
from . import defaults, validators
class InstanceConfig(BaseModel):... | true | true |
f7149d9c7f8e80f6164a3e016765476165ed9141 | 49,616 | py | Python | tensorflow/python/training/checkpointable_utils.py | imdone/tensorflow | bb4d1ef3861c83627ee9586b85ac3070a7d38335 | [
"Apache-2.0"
] | 1 | 2021-04-16T14:53:22.000Z | 2021-04-16T14:53:22.000Z | tensorflow/python/training/checkpointable_utils.py | imdone/tensorflow | bb4d1ef3861c83627ee9586b85ac3070a7d38335 | [
"Apache-2.0"
] | 10 | 2018-02-04T18:41:52.000Z | 2018-05-02T09:00:46.000Z | tensorflow/python/training/checkpointable_utils.py | imdone/tensorflow | bb4d1ef3861c83627ee9586b85ac3070a7d38335 | [
"Apache-2.0"
] | 4 | 2018-01-17T14:22:49.000Z | 2018-02-27T15:06:41.000Z | """Utilities for saving/loading Checkpointable objects."""
# Copyright 2017 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.apa... | 43.294939 | 116 | 0.730893 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import collections
import weakref
from tensorflow.core.protobuf import checkpointable_object_graph_pb2
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.client imp... | true | true |
f7149e143f5585d098d18b700bb17a159cb42dc1 | 14,337 | py | Python | airflow/api/common/experimental/mark_tasks.py | crunchbase/incubator-airflow | 903e37a09f05f4ab022bb7153be8dc62b3d9da99 | [
"Apache-2.0"
] | null | null | null | airflow/api/common/experimental/mark_tasks.py | crunchbase/incubator-airflow | 903e37a09f05f4ab022bb7153be8dc62b3d9da99 | [
"Apache-2.0"
] | 22 | 2019-12-09T23:22:07.000Z | 2021-05-12T23:15:40.000Z | airflow/api/common/experimental/mark_tasks.py | crunchbase/incubator-airflow | 903e37a09f05f4ab022bb7153be8dc62b3d9da99 | [
"Apache-2.0"
] | 5 | 2019-11-18T13:19:29.000Z | 2020-03-25T13:20:29.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 38.334225 | 99 | 0.68515 |
import datetime
from typing import Iterable
from sqlalchemy import or_
from airflow.jobs import BackfillJob
from airflow.models import BaseOperator, DagRun, TaskInstance
from airflow.operators.subdag_operator import SubDagOperator
from airflow.utils import timezone
from airflow.utils.db import prov... | true | true |
f7149e2412d81d75a93d4991ff57ab4e7bd62d19 | 1,125 | py | Python | laplace/__init__.py | georgezefko/Laplace | c488f7bf739297bab5d771f65635352a07716ca0 | [
"MIT"
] | null | null | null | laplace/__init__.py | georgezefko/Laplace | c488f7bf739297bab5d771f65635352a07716ca0 | [
"MIT"
] | null | null | null | laplace/__init__.py | georgezefko/Laplace | c488f7bf739297bab5d771f65635352a07716ca0 | [
"MIT"
] | null | null | null | """
.. include:: ../README.md
.. include:: ../examples/regression_example.md
.. include:: ../examples/calibration_example.md
"""
REGRESSION = 'regression'
CLASSIFICATION = 'classification'
from laplace.baselaplace import BaseLaplace, ParametricLaplace, FullLaplace, KronLaplace, DiagLaplace, LowRankLaplace
from laplac... | 46.875 | 117 | 0.734222 | REGRESSION = 'regression'
CLASSIFICATION = 'classification'
from laplace.baselaplace import BaseLaplace, ParametricLaplace, FullLaplace, KronLaplace, DiagLaplace, LowRankLaplace
from laplace.lllaplace import LLLaplace, FullLLLaplace, KronLLLaplace, DiagLLLaplace
from laplace.subnetlaplace import SubnetLaplace, FullSub... | true | true |
f7149e6533709c3087902b7fa956335e88e12f63 | 450 | py | Python | paperplane/backends/click/echo.py | abhilash1in/paperplane | 1dfda182dc8a70fe08fa2284ea63b434246c394b | [
"MIT"
] | null | null | null | paperplane/backends/click/echo.py | abhilash1in/paperplane | 1dfda182dc8a70fe08fa2284ea63b434246c394b | [
"MIT"
] | null | null | null | paperplane/backends/click/echo.py | abhilash1in/paperplane | 1dfda182dc8a70fe08fa2284ea63b434246c394b | [
"MIT"
] | null | null | null | import logging
from typing import Optional
from paperplane.backends.click import _secho
logger = logging.getLogger(__name__)
def run(
prompt: str,
color: Optional[str] = None,
fg: Optional[str] = None,
bg: Optional[str] = None,
bold: Optional[bool] = False,
):
if prompt is not None:
r... | 23.684211 | 71 | 0.668889 | import logging
from typing import Optional
from paperplane.backends.click import _secho
logger = logging.getLogger(__name__)
def run(
prompt: str,
color: Optional[str] = None,
fg: Optional[str] = None,
bg: Optional[str] = None,
bold: Optional[bool] = False,
):
if prompt is not None:
r... | true | true |
f7149f74e1c827d11855a1dd871ba6c9659096d7 | 9,270 | py | Python | trac/web/tests/auth.py | lelit/trac | ee8f811a29321f3c0fc8b8235d143e0ffcd6d013 | [
"BSD-3-Clause"
] | 1 | 2017-08-03T07:04:28.000Z | 2017-08-03T07:04:28.000Z | trac/web/tests/auth.py | lelit/trac | ee8f811a29321f3c0fc8b8235d143e0ffcd6d013 | [
"BSD-3-Clause"
] | null | null | null | trac/web/tests/auth.py | lelit/trac | ee8f811a29321f3c0fc8b8235d143e0ffcd6d013 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | 40.480349 | 80 | 0.602697 |
import os
import trac.tests.compat
from trac.core import TracError
from trac.test import EnvironmentStub, Mock
from trac.web.auth import BasicAuthentication, LoginModule
from trac.web.href import Href
from Cookie import SimpleCookie as Cookie
import unittest
class LoginModuleTestCase(unittest.TestCase)... | true | true |
f7149f8bfbbe334b4581ab62205607d9646fef42 | 1,364 | py | Python | tests/test_download.py | iacopoff/climetlab | cc01604de991928018291725407d891f3c01ce5b | [
"Apache-2.0"
] | null | null | null | tests/test_download.py | iacopoff/climetlab | cc01604de991928018291725407d891f3c01ce5b | [
"Apache-2.0"
] | null | null | null | tests/test_download.py | iacopoff/climetlab | cc01604de991928018291725407d891f3c01ce5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its statu... | 26.230769 | 88 | 0.725806 |
import os
import pathlib
import time
from climetlab import settings
from climetlab.utils import download_and_cache
def path_to_url(path):
return pathlib.Path(os.path.abspath(path)).as_uri()
def test_download_1():
url = "https://github.com/ecmwf/climetlab/raw/main/docs/examples/test.grib?_=%s" % ... | true | true |
f7149ff103223405ef329d427e9cce2551ef21f0 | 207 | py | Python | vet_website/vet_website/doctype/vetasset/test_vetasset.py | rezazrna/vet_website | 26e731cb10c31d69292f33659c49c3cfa5646c39 | [
"MIT"
] | null | null | null | vet_website/vet_website/doctype/vetasset/test_vetasset.py | rezazrna/vet_website | 26e731cb10c31d69292f33659c49c3cfa5646c39 | [
"MIT"
] | null | null | null | vet_website/vet_website/doctype/vetasset/test_vetasset.py | rezazrna/vet_website | 26e731cb10c31d69292f33659c49c3cfa5646c39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, bikbuk and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestVetAsset(unittest.TestCase):
pass
| 18.818182 | 45 | 0.758454 |
from __future__ import unicode_literals
import unittest
class TestVetAsset(unittest.TestCase):
pass
| true | true |
f714a04a559914d1915f3c51c7c305616a25454f | 2,090 | py | Python | setup.py | kruserr/i6 | 90a198ae543844faa1073d8bd317f11e1bb80298 | [
"MIT"
] | 1 | 2020-07-05T22:08:22.000Z | 2020-07-05T22:08:22.000Z | setup.py | kruserr/i6 | 90a198ae543844faa1073d8bd317f11e1bb80298 | [
"MIT"
] | null | null | null | setup.py | kruserr/i6 | 90a198ae543844faa1073d8bd317f11e1bb80298 | [
"MIT"
] | null | null | null | import setuptools
import urllib.request
DESCRIPTION = 'A standardized collection of python libs and tools'
try:
with open('README.md', 'r') as f:
LONG_DESCRIPTION = f.read()
except FileNotFoundError:
LONG_DESCRIPTION = DESCRIPTION
try:
with open('VERSION', 'r') as f:
VERSION = f.read()
e... | 26.455696 | 88 | 0.574641 | import setuptools
import urllib.request
DESCRIPTION = 'A standardized collection of python libs and tools'
try:
with open('README.md', 'r') as f:
LONG_DESCRIPTION = f.read()
except FileNotFoundError:
LONG_DESCRIPTION = DESCRIPTION
try:
with open('VERSION', 'r') as f:
VERSION = f.read()
e... | true | true |
f714a04aab9e0bff1e00c2120d335960fe4730f0 | 9,816 | py | Python | surveysim/music2/interpolate.py | jakgel/clusterbuster | d79400a0faf43dece457d99b024b955aef544fc2 | [
"MIT"
] | 1 | 2018-09-10T14:06:45.000Z | 2018-09-10T14:06:45.000Z | surveysim/music2/interpolate.py | jakgel/clusterbuster | d79400a0faf43dece457d99b024b955aef544fc2 | [
"MIT"
] | null | null | null | surveysim/music2/interpolate.py | jakgel/clusterbuster | d79400a0faf43dece457d99b024b955aef544fc2 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.interpolate as interpolate
import matplotlib.pyplot as plt
import clusterbuster.mathut as math
"""
Start with e.g. InterpolateRadio2D(psiFile = '../Analysis_MUSIC2/Hoeft_radio/mach_psi_tablefine(10,3).txt', inter=(10,6))
"""
# from http://stackoverflow.... | 42.310345 | 262 | 0.561125 | import numpy as np
import scipy.interpolate as interpolate
import matplotlib.pyplot as plt
import clusterbuster.mathut as math
def my_interp(X, Y, Z, x, y, spn=3):
xs,ys = map(np.array,(x,y))
z = np.zeros(xs.shape)
for i,(x,y) in enumerate(zip(xs,ys)):
xi = ... | true | true |
f714a0761443c704df72e831e1a6e9881201965d | 202 | py | Python | flutterapi/myapp/models.py | PariTA05/Todolist | fa18d02e3f989cbb37f877fb18e3e715bfc76f0c | [
"MIT"
] | null | null | null | flutterapi/myapp/models.py | PariTA05/Todolist | fa18d02e3f989cbb37f877fb18e3e715bfc76f0c | [
"MIT"
] | null | null | null | flutterapi/myapp/models.py | PariTA05/Todolist | fa18d02e3f989cbb37f877fb18e3e715bfc76f0c | [
"MIT"
] | null | null | null | from django.db import models
class Todolist(models.Model):
title = models.CharField(max_length=100)
detail = models.TextField(null=True, blank=True)
def __str__(self):
return self.title | 25.25 | 50 | 0.732673 | from django.db import models
class Todolist(models.Model):
title = models.CharField(max_length=100)
detail = models.TextField(null=True, blank=True)
def __str__(self):
return self.title | true | true |
f714a098ed7801e900ae6b4770cd7b10a0067882 | 301 | py | Python | hackerrank/an-interesting-game-1/solution.py | SamProkopchuk/coding-problems | fa0ca2c05ac90e41945de1a5751e5545a8459ac4 | [
"MIT"
] | null | null | null | hackerrank/an-interesting-game-1/solution.py | SamProkopchuk/coding-problems | fa0ca2c05ac90e41945de1a5751e5545a8459ac4 | [
"MIT"
] | null | null | null | hackerrank/an-interesting-game-1/solution.py | SamProkopchuk/coding-problems | fa0ca2c05ac90e41945de1a5751e5545a8459ac4 | [
"MIT"
] | null | null | null | for _ in range(int(input())):
n = int(input())
rounds = 0
minidx = 1_000_000_000
for _, idx in sorted(zip(map(int, input().split()), range(n)), reverse=True):
if idx < minidx:
minidx = idx
rounds += 1
print("BOB" if rounds % 2 else "ANDY")
| 30.1 | 82 | 0.521595 | for _ in range(int(input())):
n = int(input())
rounds = 0
minidx = 1_000_000_000
for _, idx in sorted(zip(map(int, input().split()), range(n)), reverse=True):
if idx < minidx:
minidx = idx
rounds += 1
print("BOB" if rounds % 2 else "ANDY")
| true | true |
f714a0caf548812f27ce214b01b5f8336d284c42 | 4,545 | py | Python | note12/download_text_data.py | zhuyawen/LearnPaddle2 | c2ed0cea1634159b1f005a0d2d954ce44b51b739 | [
"Apache-2.0"
] | 163 | 2019-01-30T04:34:01.000Z | 2021-12-10T12:19:03.000Z | note12/download_text_data.py | stonebb/LearnPaddle2 | c3b6a9f5897e684b6de544cb12c959f7771a6c3c | [
"Apache-2.0"
] | 3 | 2019-07-15T07:14:17.000Z | 2022-03-24T01:14:06.000Z | note12/download_text_data.py | stonebb/LearnPaddle2 | c3b6a9f5897e684b6de544cb12c959f7771a6c3c | [
"Apache-2.0"
] | 83 | 2018-10-31T02:44:09.000Z | 2022-03-25T13:40:54.000Z | import os
import random
import requests
import json
import time
# 分类新闻参数
news_classify = [
[0, '民生', 'news_story'],
[1, '文化', 'news_culture'],
[2, '娱乐', 'news_entertainment'],
[3, '体育', 'news_sports'],
[4, '财经', 'news_finance'],
[5, '房产', 'news_house'],
[6, '汽车', 'news_car'],
[7, '教育', ... | 40.945946 | 475 | 0.572937 | import os
import random
import requests
import json
import time
news_classify = [
[0, '民生', 'news_story'],
[1, '文化', 'news_culture'],
[2, '娱乐', 'news_entertainment'],
[3, '体育', 'news_sports'],
[4, '财经', 'news_finance'],
[5, '房产', 'news_house'],
[6, '汽车', 'news_car'],
[7, '教育', 'news_ed... | true | true |
f714a1b02ca1276050523ec8c90956dae69d86bf | 3,521 | py | Python | tools/emprofile.py | talrasha/emscripten | 5ece531a4bc724b133da0e1b0ce061e0c2e7bebd | [
"MIT"
] | 1 | 2021-06-15T20:40:30.000Z | 2021-06-15T20:40:30.000Z | tools/emprofile.py | talrasha/emscripten | 5ece531a4bc724b133da0e1b0ce061e0c2e7bebd | [
"MIT"
] | null | null | null | tools/emprofile.py | talrasha/emscripten | 5ece531a4bc724b133da0e1b0ce061e0c2e7bebd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import json
import os
import shutil
import sys
... | 32.302752 | 197 | 0.650099 |
import json
import os
import shutil
import sys
import tempfile
import time
profiler_logs_path = os.path.join(tempfile.gettempdir(), 'emscripten_toolchain_profiler_logs')
OUTFILE = 'emprofile.' + time.strftime('%Y%m%d_%H%M')
for i in range(len(sys.argv)):
arg = sys.argv[i]
if arg.startswith('--outfile=') or ... | true | true |
f714a32598047c41a41ca8c84b2495aad909f3ac | 829 | py | Python | QiuBaiSpider/spider_main.py | lidenghong1/SmallReptileTraining | a1bfb81c9969edfb7554acc50370c0cb036da690 | [
"MIT"
] | 133 | 2017-06-10T02:18:00.000Z | 2022-01-08T03:29:08.000Z | QiuBaiSpider/spider_main.py | ljj2666/SmallReptileTraining | b6253e835120da457c416fbf4a012e545d9c70ad | [
"MIT"
] | null | null | null | QiuBaiSpider/spider_main.py | ljj2666/SmallReptileTraining | b6253e835120da457c416fbf4a012e545d9c70ad | [
"MIT"
] | 212 | 2017-06-14T03:29:22.000Z | 2022-01-29T15:14:47.000Z | from QiuBaiSpider.pymysqldb_manager import DbManager
from QiuBaiSpider.page_items import PageItems
from QiuBaiSpider.tools import Tools
'''
爬取糗事百科笑话剔除正文DOM标签然后将爬取数据存入MySQL数据库
Extra module:
PyMySQL
'''
class Main(object):
def __init__(self, max_page=1):
self.max_page = max_page
self.db_manager = Db... | 24.382353 | 63 | 0.679131 | from QiuBaiSpider.pymysqldb_manager import DbManager
from QiuBaiSpider.page_items import PageItems
from QiuBaiSpider.tools import Tools
class Main(object):
def __init__(self, max_page=1):
self.max_page = max_page
self.db_manager = DbManager()
def run(self):
self.db_manager.connect()
... | true | true |
f714a3eab380aa3fea7349fb1fb1cb7718fcf9fb | 2,713 | py | Python | test/pyaz/acr/helm/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/acr/helm/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/acr/helm/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def list(name, repository=None, resource_group=None, suffix=None, username=None, password=None):
params = get_params(locals())
command = "az acr helm list " + params
print(command)
output = subprocess.run(command, shell=Tru... | 36.662162 | 133 | 0.669001 | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def list(name, repository=None, resource_group=None, suffix=None, username=None, password=None):
params = get_params(locals())
command = "az acr helm list " + params
print(command)
output = subprocess.run(command, shell=Tru... | true | true |
f714a4d032c0d9c04d96fb38385edc266e67dc16 | 516 | py | Python | worker/Facebook/service1/main.py | OmarZOS/remote-extraction-proxy-and-worker | 739466a0df588d7eb5b1dae9666ceb8c7a25e928 | [
"MIT"
] | null | null | null | worker/Facebook/service1/main.py | OmarZOS/remote-extraction-proxy-and-worker | 739466a0df588d7eb5b1dae9666ceb8c7a25e928 | [
"MIT"
] | 10 | 2022-03-17T23:23:18.000Z | 2022-03-18T00:15:11.000Z | worker/Facebook/service1/main.py | OmarZOS/remote-extraction-proxy-and-worker | 739466a0df588d7eb5b1dae9666ceb8c7a25e928 | [
"MIT"
] | 1 | 2022-03-24T23:56:46.000Z | 2022-03-24T23:56:46.000Z | from http import cookies
from Extractor import Extractor
from context import Context
import networkx as nx
from facebook_scraper import get_posts,get_friends,get_profile,get_group_info
cxt=Context(account,creds,limit_post,limit_friends,max,post,False,True)
#print(get_profile("100009975842374"))
#prin... | 17.793103 | 77 | 0.813953 | from http import cookies
from Extractor import Extractor
from context import Context
import networkx as nx
from facebook_scraper import get_posts,get_friends,get_profile,get_group_info
cxt=Context(account,creds,limit_post,limit_friends,max,post,False,True)
ex =Extractor('Fb',cxt,Schema,cookie)
ex.... | true | true |
f714a58617a8965d0d4cc18d282b5dffc7518090 | 4,801 | py | Python | main.py | ammar-khan/raspberry-pi-opencv-dnn-face-detection | 04ea998ee9e4d7bf71da022b0d8613940e8e7cfb | [
"MIT"
] | 3 | 2018-10-25T05:01:13.000Z | 2021-01-22T11:29:15.000Z | main.py | ammar-khan/raspberry-pi-opencv-dnn-face-detection | 04ea998ee9e4d7bf71da022b0d8613940e8e7cfb | [
"MIT"
] | null | null | null | main.py | ammar-khan/raspberry-pi-opencv-dnn-face-detection | 04ea998ee9e4d7bf71da022b0d8613940e8e7cfb | [
"MIT"
] | 1 | 2019-08-24T19:22:04.000Z | 2019-08-24T19:22:04.000Z | ##
# Copyright 2018, Ammar Ali Khan
# Licensed under MIT.
# Since: v1.0.0
##
import time
import cv2
import numpy as np
from src.common.package.config import application
from src.opencv.package.config import application as _application
from src.common.package.http import server as _server
from src.common.package.http.h... | 34.789855 | 109 | 0.534264 |
import time
import cv2
import numpy as np
from src.common.package.config import application
from src.opencv.package.config import application as _application
from src.common.package.http import server as _server
from src.common.package.http.handler import Handler
from src.common.package.camera.capture import Captur... | true | true |
f714a5f04300870022842049f2926bc20c34e5c2 | 4,647 | py | Python | nova/tests/functional/libvirt/test_live_migration.py | muraliselva10/nova | 97626394bcce5c8cd020b136ca54a6aa919eb3a9 | [
"Apache-2.0"
] | 1 | 2022-02-24T08:49:48.000Z | 2022-02-24T08:49:48.000Z | nova/tests/functional/libvirt/test_live_migration.py | muraliselva10/nova | 97626394bcce5c8cd020b136ca54a6aa919eb3a9 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/libvirt/test_live_migration.py | muraliselva10/nova | 97626394bcce5c8cd020b136ca54a6aa919eb3a9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Red Hat, 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 or agreed to in writin... | 39.381356 | 75 | 0.663869 |
import threading
from lxml import etree
from nova.tests.functional import integrated_helpers
from nova.tests.functional.libvirt import base as libvirt_base
class LiveMigrationQueuedAbortTest(
libvirt_base.LibvirtMigrationMixin,
libvirt_base.ServersTestBase,
integrated_helpers.InstanceHelper... | true | true |
f714a5ff5c93a84a57edfda15f6f4e42f0eb012f | 175 | py | Python | run.py | B02902008/TaipeiWater | 7364ce0bdfafddb7448cd8943c0c048f1a199dda | [
"MIT"
] | null | null | null | run.py | B02902008/TaipeiWater | 7364ce0bdfafddb7448cd8943c0c048f1a199dda | [
"MIT"
] | null | null | null | run.py | B02902008/TaipeiWater | 7364ce0bdfafddb7448cd8943c0c048f1a199dda | [
"MIT"
] | null | null | null | from app import app
if __name__ == '__main__':
context = ('/etc/ssl/certificate.crt', '/etc/ssl/private.key')
app.run(host='0.0.0.0', port=8443, ssl_context=context)
| 29.166667 | 66 | 0.668571 | from app import app
if __name__ == '__main__':
context = ('/etc/ssl/certificate.crt', '/etc/ssl/private.key')
app.run(host='0.0.0.0', port=8443, ssl_context=context)
| true | true |
f714a7605ee022f93df4415ea3b71026282a989e | 30 | py | Python | dolphindb_numpy/polynomial/__init__.py | jiajiaxu123/Orca | e86189e70c1d0387816bb98b8047a6232fbda9df | [
"Apache-2.0"
] | 20 | 2019-12-02T11:49:12.000Z | 2021-12-24T19:34:32.000Z | dolphindb_numpy/polynomial/__init__.py | jiajiaxu123/Orca | e86189e70c1d0387816bb98b8047a6232fbda9df | [
"Apache-2.0"
] | null | null | null | dolphindb_numpy/polynomial/__init__.py | jiajiaxu123/Orca | e86189e70c1d0387816bb98b8047a6232fbda9df | [
"Apache-2.0"
] | 5 | 2019-12-02T12:16:22.000Z | 2021-10-22T02:27:47.000Z | from numpy.polynomial import * | 30 | 30 | 0.833333 | from numpy.polynomial import * | true | true |
f714a765ed3fdb8802a47ef9a05184c1987b46ec | 2,243 | py | Python | transfer/rcvfromelf.py | arhefner/max_mon | 75c02804089c957c53bf5f68c52f89ba5ceeb5bc | [
"MIT"
] | null | null | null | transfer/rcvfromelf.py | arhefner/max_mon | 75c02804089c957c53bf5f68c52f89ba5ceeb5bc | [
"MIT"
] | null | null | null | transfer/rcvfromelf.py | arhefner/max_mon | 75c02804089c957c53bf5f68c52f89ba5ceeb5bc | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import click
import serial
from enum import Enum, auto
from intelhex import IntelHex,IntelHexError
import constants
@click.command()
@click.argument(
'file',
required=True,
type=click.Path(dir_okay=False, writable=True)
)
@click.option(
'--append', '-a',
help='append data to... | 27.353659 | 68 | 0.532769 |
import click
import serial
from enum import Enum, auto
from intelhex import IntelHex,IntelHexError
import constants
@click.command()
@click.argument(
'file',
required=True,
type=click.Path(dir_okay=False, writable=True)
)
@click.option(
'--append', '-a',
help='append data to hex file',
is_flag... | true | true |
f714a790e3dbb16554cbe41c2190b6201936b882 | 1,522 | py | Python | app.py | tylerhand/cals-floor | e8f88641e73425ad911f91984b0915cc0cec5446 | [
"MIT"
] | null | null | null | app.py | tylerhand/cals-floor | e8f88641e73425ad911f91984b0915cc0cec5446 | [
"MIT"
] | 2 | 2019-08-12T05:21:10.000Z | 2019-08-24T20:18:03.000Z | app.py | tylerhand/cals-floor | e8f88641e73425ad911f91984b0915cc0cec5446 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, redirect, abort, send_file
from flaskext.markdown import Markdown
import os.path
from config import config
app = Flask(__name__)
Markdown(app)
site_title=config['site_title']
site_all_notification=config['site_all_notification']
footer='<small class="m-0 text-center text-whi... | 31.061224 | 196 | 0.756899 | from flask import Flask, render_template, redirect, abort, send_file
from flaskext.markdown import Markdown
import os.path
from config import config
app = Flask(__name__)
Markdown(app)
site_title=config['site_title']
site_all_notification=config['site_all_notification']
footer='<small class="m-0 text-center text-whi... | true | true |
f714a7f94b14209c01ac9354696aa33df0b5f72f | 7,695 | py | Python | docs/conf.py | hayata-yamamoto/tgs | 9ace499b572afb72bdd43a579bb2520d5aa24e85 | [
"MIT"
] | 1 | 2018-07-21T07:35:05.000Z | 2018-07-21T07:35:05.000Z | docs/conf.py | hayata-yamamoto/tgs | 9ace499b572afb72bdd43a579bb2520d5aa24e85 | [
"MIT"
] | 3 | 2018-07-21T07:39:59.000Z | 2018-07-21T08:54:33.000Z | docs/conf.py | hayata-yamamoto/tgs | 9ace499b572afb72bdd43a579bb2520d5aa24e85 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# tgs documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a def... | 31.408163 | 80 | 0.704483 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'tgs'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full ve... | true | true |
f714a8349c35175175f8b080184942a963cc06c4 | 7,278 | py | Python | onir/datasets/irds.py | Georgetown-IR-Lab/OpenNIR | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | [
"MIT"
] | 140 | 2020-02-05T23:48:53.000Z | 2022-03-29T03:47:31.000Z | onir/datasets/irds.py | Georgetown-IR-Lab/OpenNIR | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | [
"MIT"
] | 33 | 2020-03-19T22:07:58.000Z | 2022-02-23T15:18:29.000Z | onir/datasets/irds.py | Georgetown-IR-Lab/OpenNIR | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | [
"MIT"
] | 16 | 2020-03-19T19:01:04.000Z | 2021-12-12T04:18:57.000Z | import os
import io
import itertools
import gzip
import tarfile
import zipfile
import contextlib
import functools
from tqdm import tqdm
from pytools import memoize_method
import pandas as pd
import ir_datasets
import onir
from onir import util, datasets, indices
from onir.interfaces import trec, plaintext
def sanitiz... | 44.109091 | 132 | 0.632454 | import os
import io
import itertools
import gzip
import tarfile
import zipfile
import contextlib
import functools
from tqdm import tqdm
from pytools import memoize_method
import pandas as pd
import ir_datasets
import onir
from onir import util, datasets, indices
from onir.interfaces import trec, plaintext
def sanitiz... | true | true |
f714a85c25186d4ad6710276141011796da70208 | 89 | py | Python | unidade/apps.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | 1 | 2017-04-27T19:26:49.000Z | 2017-04-27T19:26:49.000Z | unidade/apps.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | null | null | null | unidade/apps.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UnidadeConfig(AppConfig):
name = 'unidade'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class UnidadeConfig(AppConfig):
name = 'unidade'
| true | true |
f714a8ad00f77d833fe83f5364b33aa3d0322404 | 988 | py | Python | python/paddle/fluid/tests/unittests/test_dist_mnist_lars.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/test_dist_mnist_lars.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_dist_mnist_lars.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2018 PaddlePaddle 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.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.875 | 74 | 0.751012 |
from __future__ import print_function
import unittest
from test_dist_base import TestDistBase
class TestDistMnist2x2Lars(TestDistBase):
def _setup_config(self):
self._sync_mode = True
self._use_reduce = False
def test_se_resnext(self):
self.check_with_place("dist_mnist_... | true | true |
f714a910233f8c72b6035a03576874ffbf9fc901 | 152,100 | py | Python | salt/modules/cmdmod.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | salt/modules/cmdmod.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | salt/modules/cmdmod.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A module for shelling out.
Keep in mind that this module is insecure, in that it can give whomever has
access to the master root execution access to all salt minions.
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import functools
import g... | 37.389381 | 121 | 0.598685 |
from __future__ import absolute_import, print_function, unicode_literals
import functools
import glob
import logging
import os
import shutil
import subprocess
import sys
import time
import traceback
import fnmatch
import base64
import re
import tempfile
import salt.utils.args
import salt.utils.data
import salt.uti... | true | true |
f714a941e1710abfe811a893f00e369a5965accf | 37,199 | py | Python | src/windows10_system_logger.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | 1 | 2019-11-19T00:14:03.000Z | 2019-11-19T00:14:03.000Z | src/windows10_system_logger.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | null | null | null | src/windows10_system_logger.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | 1 | 2017-10-03T03:21:27.000Z | 2017-10-03T03:21:27.000Z |
DEFAULT_CONFIG = "Windows10SystemLog.txt"
class Windows10SystemLogger:
"""
Windows10SystemLogger writes error messages to the Windows10 System log
file for every rule in the Windows10 STIG that is violated.
"""
def __init__(self, filename=DEFAULT_CONFIG):
self.filename = f... | 45.642945 | 186 | 0.625581 |
DEFAULT_CONFIG = "Windows10SystemLog.txt"
class Windows10SystemLogger:
def __init__(self, filename=DEFAULT_CONFIG):
self.filename = filename
self.log = open(filename, 'w')
self.log.write("#########################\n\n")
self.log.write("Windows10 System Audit Finding... | true | true |
f714a9a3b54319c86838c7546260c190131c7098 | 1,978 | py | Python | test/TestExpressionParser.py | imrushabh/cronjob-expression-parser | 8e577245e7956fa85222bbc5f37beb13aba7819b | [
"MIT"
] | null | null | null | test/TestExpressionParser.py | imrushabh/cronjob-expression-parser | 8e577245e7956fa85222bbc5f37beb13aba7819b | [
"MIT"
] | null | null | null | test/TestExpressionParser.py | imrushabh/cronjob-expression-parser | 8e577245e7956fa85222bbc5f37beb13aba7819b | [
"MIT"
] | null | null | null | import TestConstants
from generator.ExpressionParser import ExpressionParser
import unittest
class TestExpressionParser(unittest.TestCase):
# Test to verify the minute functionality & */multiple expression check.
def test_valid_minute_parsing(self):
expressionParser = ExpressionParser(TestConstants.V... | 52.052632 | 109 | 0.776036 | import TestConstants
from generator.ExpressionParser import ExpressionParser
import unittest
class TestExpressionParser(unittest.TestCase):
def test_valid_minute_parsing(self):
expressionParser = ExpressionParser(TestConstants.Valid_cron_expression)
self.assertListEqual(expressionParser._par... | true | true |
f714aa4914f7a4f30b2904dd1876178860dd2364 | 44,061 | py | Python | zerver/tests/test_slack_importer.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-03-17T14:58:50.000Z | 2020-03-17T14:58:50.000Z | zerver/tests/test_slack_importer.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_slack_importer.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-07-16T06:00:10.000Z | 2020-07-16T06:00:10.000Z | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils.timezone import now as timezone_now
from zerver.data_import.slack import (
get_slack_api_data,
get_admin,
get_guest,
get_user_timezone,
fetch_shared_channel_users,
users_to_zerver_userprofile,
get_subscription,
c... | 52.204976 | 142 | 0.615737 |
from django.conf import settings
from django.utils.timezone import now as timezone_now
from zerver.data_import.slack import (
get_slack_api_data,
get_admin,
get_guest,
get_user_timezone,
fetch_shared_channel_users,
users_to_zerver_userprofile,
get_subscription,
channels_to_zerver_strea... | true | true |
f714ab74caa7e9e880df60f9b2934a8d8fa7d891 | 682 | py | Python | mfr_rst/tests/test_rst.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | mfr_rst/tests/test_rst.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | mfr_rst/tests/test_rst.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | import pytest
import mfr
import mfr_rst
def test_detect(fakefile):
# set filename to have .rst extension
fakefile.name = 'mydoc.rst'
handler = mfr_rst.Handler()
assert handler.detect(fakefile) is True
@pytest.mark.parametrize('filename', [
'other.rs',
'otherrst',
'other',
'other.',
]... | 22.733333 | 62 | 0.705279 | import pytest
import mfr
import mfr_rst
def test_detect(fakefile):
fakefile.name = 'mydoc.rst'
handler = mfr_rst.Handler()
assert handler.detect(fakefile) is True
@pytest.mark.parametrize('filename', [
'other.rs',
'otherrst',
'other',
'other.',
])
def test_does_not_detect_other_exte... | true | true |
f714aba34194863f081881943a6ccb4ee1151632 | 1,252 | py | Python | pyfronius/tests/web_raw/v0/web_state.py | mgrela/pyfronius | 0ed5b0d4032870292576336b66922360a1fcd4a2 | [
"MIT"
] | null | null | null | pyfronius/tests/web_raw/v0/web_state.py | mgrela/pyfronius | 0ed5b0d4032870292576336b66922360a1fcd4a2 | [
"MIT"
] | null | null | null | pyfronius/tests/web_raw/v0/web_state.py | mgrela/pyfronius | 0ed5b0d4032870292576336b66922360a1fcd4a2 | [
"MIT"
] | null | null | null | GET_INVERTER_REALTIME_DATA_SCOPE_DEVICE = {
"timestamp": {"value": "2020-09-18T14:14:24-07:00"},
"status": {"Code": 0, "Reason": "", "UserMessage": ""},
"energy_day": {"value": 6000, "unit": "Wh"},
"energy_total": {"value": 35611000, "unit": "Wh"},
"energy_year": {"value": 3310000, "unit": "Wh"},
... | 40.387097 | 62 | 0.51278 | GET_INVERTER_REALTIME_DATA_SCOPE_DEVICE = {
"timestamp": {"value": "2020-09-18T14:14:24-07:00"},
"status": {"Code": 0, "Reason": "", "UserMessage": ""},
"energy_day": {"value": 6000, "unit": "Wh"},
"energy_total": {"value": 35611000, "unit": "Wh"},
"energy_year": {"value": 3310000, "unit": "Wh"},
... | true | true |
f714ad0d90636742e89950dcb0be23eb7b1ca571 | 9,508 | py | Python | axi/planner.py | ejkaplan/axi | cb17cc3ec8093b1f029674dce88711a9c8a293db | [
"MIT"
] | null | null | null | axi/planner.py | ejkaplan/axi | cb17cc3ec8093b1f029674dce88711a9c8a293db | [
"MIT"
] | null | null | null | axi/planner.py | ejkaplan/axi | cb17cc3ec8093b1f029674dce88711a9c8a293db | [
"MIT"
] | null | null | null | from __future__ import division
from bisect import bisect
from collections import namedtuple
from math import sqrt, hypot
# a planner computes a motion profile for a list of (x, y) points
class Planner(object):
def __init__(self, acceleration, max_velocity, corner_factor):
self.acceleration = acceleratio... | 29.436533 | 86 | 0.538915 | from __future__ import division
from bisect import bisect
from collections import namedtuple
from math import sqrt, hypot
class Planner(object):
def __init__(self, acceleration, max_velocity, corner_factor):
self.acceleration = acceleration
self.max_velocity = max_velocity
self.corner_fa... | true | true |
f714ad9713e72b5a8334c0e62b82795f8e43fffe | 20,736 | py | Python | mpf/devices/logic_blocks.py | Wolfmarsh/mpf | ad71f381ce8a0e65f28958e51cf8a8b38a6154fb | [
"MIT"
] | null | null | null | mpf/devices/logic_blocks.py | Wolfmarsh/mpf | ad71f381ce8a0e65f28958e51cf8a8b38a6154fb | [
"MIT"
] | null | null | null | mpf/devices/logic_blocks.py | Wolfmarsh/mpf | ad71f381ce8a0e65f28958e51cf8a8b38a6154fb | [
"MIT"
] | null | null | null | """Logic Blocks devices."""
from typing import Any, List
from mpf.core.delays import DelayManager
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.machine import MachineController
from mpf.core.mode import Mode
from mpf.core.mode_device import ModeDevice
from mp... | 34.733668 | 119 | 0.624904 | from typing import Any, List
from mpf.core.delays import DelayManager
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.machine import MachineController
from mpf.core.mode import Mode
from mpf.core.mode_device import ModeDevice
from mpf.core.player import Player
... | true | true |
f714ad9a06849425b9f24c8d797c655c90f7b75e | 4,463 | py | Python | newapi/ooniapi/prio.py | cyBerta/api | af8e15a800ffc272799a269f4801cbdd174d0c43 | [
"BSD-3-Clause"
] | null | null | null | newapi/ooniapi/prio.py | cyBerta/api | af8e15a800ffc272799a269f4801cbdd174d0c43 | [
"BSD-3-Clause"
] | null | null | null | newapi/ooniapi/prio.py | cyBerta/api | af8e15a800ffc272799a269f4801cbdd174d0c43 | [
"BSD-3-Clause"
] | null | null | null | """
OONI Probe Services API - URL prioritization
"""
from typing import List
import random
import time
from flask import Blueprint, current_app, request
from flask.json import jsonify
prio_bp = Blueprint("prio", "probe_services_prio")
# TODO add unit tests
test_items = {}
last_update_time = 0
def update_url_pri... | 28.980519 | 81 | 0.599149 |
from typing import List
import random
import time
from flask import Blueprint, current_app, request
from flask.json import jsonify
prio_bp = Blueprint("prio", "probe_services_prio")
test_items = {}
last_update_time = 0
def update_url_prioritization():
log = current_app.logger
log.info("Started update_ur... | true | true |
f714af1996211444cf3b111bbef2e05f72c01ea6 | 7,708 | py | Python | ibmsecurity/isam/base/extensions.py | zone-zero/ibmsecurity | 7d3e38104b67e1b267e18a44845cb756a5302c3d | [
"Apache-2.0"
] | 46 | 2017-03-21T21:08:59.000Z | 2022-02-20T22:03:46.000Z | ibmsecurity/isam/base/extensions.py | zone-zero/ibmsecurity | 7d3e38104b67e1b267e18a44845cb756a5302c3d | [
"Apache-2.0"
] | 201 | 2017-03-21T21:25:52.000Z | 2022-03-30T21:38:20.000Z | ibmsecurity/isam/base/extensions.py | zone-zero/ibmsecurity | 7d3e38104b67e1b267e18a44845cb756a5302c3d | [
"Apache-2.0"
] | 91 | 2017-03-22T16:25:36.000Z | 2022-02-04T04:36:29.000Z | import json
import logging
import ibmsecurity.utilities.tools
from ibmsecurity.utilities import tools
from io import open
logger = logging.getLogger(__name__)
uri = "/extensions"
requires_modules = None
requires_version = "9.0.5.0"
try:
basestring
except NameError:
basestring = (str, bytes)
def get_all(isa... | 34.565022 | 137 | 0.601583 | import json
import logging
import ibmsecurity.utilities.tools
from ibmsecurity.utilities import tools
from io import open
logger = logging.getLogger(__name__)
uri = "/extensions"
requires_modules = None
requires_version = "9.0.5.0"
try:
basestring
except NameError:
basestring = (str, bytes)
def get_all(isa... | true | true |
f714b043ee7c349b87647ed2e5e6463196b1863f | 946 | py | Python | ccobra/benchmark/__init__.py | CognitiveComputationLab/orca | 432753acff6072c158047000111a66f822aa51f3 | [
"MIT"
] | 9 | 2019-03-19T08:51:55.000Z | 2021-08-19T13:29:54.000Z | ccobra/benchmark/__init__.py | CognitiveComputationLab/orca | 432753acff6072c158047000111a66f822aa51f3 | [
"MIT"
] | 16 | 2018-11-27T13:30:34.000Z | 2020-06-02T14:15:12.000Z | ccobra/benchmark/__init__.py | CognitiveComputationLab/orca | 432753acff6072c158047000111a66f822aa51f3 | [
"MIT"
] | 6 | 2018-10-15T13:27:44.000Z | 2021-08-19T13:29:56.000Z | """ CCOBRA benchmark functionality.
.. rubric:: Submodules
.. autosummary::
:toctree: _autosummary
ccobra.benchmark.comparators
.. rubric:: Functions
.. autofunction:: dir_context
.. autofunction:: entry_point
.. autofunction:: fix_model_path
.. autofunction:: fix_rel_path
.. autofunction:: main
.. autofunct... | 22 | 73 | 0.758985 |
from . import comparators
from .benchmark import Benchmark, ModelInfo, fix_rel_path, fix_model_path
from .contextmanager import dir_context
from .evaluator import Evaluator
from .modelimporter import ModelImporter
from .runner import entry_point, parse_arguments, main, silence_stdout
from .evaluation_handler import E... | true | true |
f714b118c400442b20844c9947d561af1f2c1a2b | 1,990 | py | Python | kochira/services/web/google.py | gnowxilef/kochira | 817b82ad0f0893a58e8d44f8db79ddd6fc0eae77 | [
"MS-PL"
] | null | null | null | kochira/services/web/google.py | gnowxilef/kochira | 817b82ad0f0893a58e8d44f8db79ddd6fc0eae77 | [
"MS-PL"
] | null | null | null | kochira/services/web/google.py | gnowxilef/kochira | 817b82ad0f0893a58e8d44f8db79ddd6fc0eae77 | [
"MS-PL"
] | null | null | null | """
Google web search.
Run queries on Google and return results.
"""
import requests
from kochira import config
from kochira.service import Service, background, Config, coroutine
from kochira.userdata import UserData
service = Service(__name__, __doc__)
@service.config
class Config(Config):
api_key = config.F... | 22.359551 | 91 | 0.566834 |
import requests
from kochira import config
from kochira.service import Service, background, Config, coroutine
from kochira.userdata import UserData
service = Service(__name__, __doc__)
@service.config
class Config(Config):
api_key = config.Field(doc="Google API key.")
cx = config.Field(doc="Custom search e... | true | true |
f714b283ab9ae54ec531e9b15a6b3c7e23e726ab | 1,561 | py | Python | Datacamp Assignments/Data Engineer Track/8. Introduction to AWS Boto in Python/19_sns_create_multiple_topics.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | null | null | null | Datacamp Assignments/Data Engineer Track/8. Introduction to AWS Boto in Python/19_sns_create_multiple_topics.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | null | null | null | Datacamp Assignments/Data Engineer Track/8. Introduction to AWS Boto in Python/19_sns_create_multiple_topics.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | 1 | 2021-03-10T09:40:05.000Z | 2021-03-10T09:40:05.000Z | # Creating multiple topics
# Sam suddenly became a black sheep because she is responsible for
# an onslaught of text messages and notifications to department directors.
# No one will go to lunch with her anymore!
# To fix this, she decided to create a general topic per
# department for routine notifications, and a... | 42.189189 | 409 | 0.748238 |
departments = ['trash', 'streets', 'water']
for dept in departments:
sns.create_topic(Name="{}_general".format(dept))
sns.create_topic(Name="{}_critical".format(dept))
response = sns.list_topics()
print(response['Topics'])
| true | true |
f714b3e8a0b13082e466e7c61be4a203a48afe3f | 889 | py | Python | server/utils/view_utils.py | Jordonkopp/Flask-Vue | db842f1a31f2ca4cf51ce1b2a927d6d2ad860c00 | [
"MIT"
] | 2 | 2019-02-27T16:55:01.000Z | 2019-02-27T20:23:29.000Z | server/utils/view_utils.py | Jordonkopp/Flask-Vue | db842f1a31f2ca4cf51ce1b2a927d6d2ad860c00 | [
"MIT"
] | 5 | 2020-04-30T00:01:01.000Z | 2021-10-05T19:42:15.000Z | server/utils/view_utils.py | Jordonkopp/Flask-Vue | db842f1a31f2ca4cf51ce1b2a927d6d2ad860c00 | [
"MIT"
] | null | null | null | from typing import Tuple, List
from flask import jsonify
from flask.wrappers import Response
def wrapped_response(data: dict = None, status: int = 200, message: str = "") -> Tuple[Response, int]:
"""
Create a wrapped response to have uniform json response objects
"""
if type(data) is not dict and da... | 26.939394 | 102 | 0.649044 | from typing import Tuple, List
from flask import jsonify
from flask.wrappers import Response
def wrapped_response(data: dict = None, status: int = 200, message: str = "") -> Tuple[Response, int]:
if type(data) is not dict and data is not None:
raise TypeError("Expected data to be type Dictionary")
... | true | true |
f714b4d3fcbc5ab3998518dc08e155b098493405 | 10,591 | py | Python | aws/AWSError.py | alexbredo/honeypot-s3 | f90c21e34b2c3079656a027cab9dc0cf7b2945c9 | [
"BSD-2-Clause"
] | null | null | null | aws/AWSError.py | alexbredo/honeypot-s3 | f90c21e34b2c3079656a027cab9dc0cf7b2945c9 | [
"BSD-2-Clause"
] | null | null | null | aws/AWSError.py | alexbredo/honeypot-s3 | f90c21e34b2c3079656a027cab9dc0cf7b2945c9 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014 Alexander Bredo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions ... | 82.742188 | 271 | 0.775942 |
defAWSerrors = dict()
defAWSerrors["AccessDenied"] = ("Access Denied",403)
defAWSerrors["AccountProblem"] = ("There is a problem with your AWS account that prevents the operation from completing successfully. Please use Contact Us.",403)
defAWSerrors["AmbiguousGrantByEmailAddress"] = ("... | true | true |
f714b5c9364ae37e0f28ed2af63d9c13870280d8 | 4,361 | py | Python | third_party/mosquitto/test/broker/06-bridge-per-listener-settings.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | null | null | null | third_party/mosquitto/test/broker/06-bridge-per-listener-settings.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | null | null | null | third_party/mosquitto/test/broker/06-bridge-per-listener-settings.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | 1 | 2021-05-04T16:09:27.000Z | 2021-05-04T16:09:27.000Z | #!/usr/bin/env python3
# Test remapping of topic name for incoming message
from mosq_test_helper import *
def write_config(filename, port1, port2, port3):
with open(filename, 'w') as f:
f.write("per_listener_settings true\n")
f.write("port %d\n" % (port2))
f.write("listener %d 127.0.0.1\n... | 33.037879 | 108 | 0.64343 |
from mosq_test_helper import *
def write_config(filename, port1, port2, port3):
with open(filename, 'w') as f:
f.write("per_listener_settings true\n")
f.write("port %d\n" % (port2))
f.write("listener %d 127.0.0.1\n" % (port3))
f.write("\n")
f.write("connection bridge_sam... | true | true |
f714b611b630264ab6b3b01d609da0098746a3ab | 5,508 | py | Python | data/p3BR/R1/benchmark/startQiskit_QC456.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_QC456.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_QC456.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=84
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.142857 | 140 | 0.629448 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo... | true | true |
f714b62fb7954e13787a00829289da3e8338b36b | 466 | py | Python | Condicional/autonomia_aviao.py | Viniciusmgm/aula_processamento_info | 6b334122896e34af51d3a8469f151bca52191585 | [
"MIT"
] | null | null | null | Condicional/autonomia_aviao.py | Viniciusmgm/aula_processamento_info | 6b334122896e34af51d3a8469f151bca52191585 | [
"MIT"
] | null | null | null | Condicional/autonomia_aviao.py | Viniciusmgm/aula_processamento_info | 6b334122896e34af51d3a8469f151bca52191585 | [
"MIT"
] | null | null | null | def autonomia(carga):
if(carga <= 50000):
return 18000, 19800
elif(carga <= 200000):
return 9000, 9900
else:
return 3000, 3300
carga = int(input())
auto = autonomia(carga)
ax = float(input())
ay = float(input())
bx = float(input())
by = float(input())
dist = (((bx - ax) ** 2) + ((by... | 20.26087 | 51 | 0.551502 | def autonomia(carga):
if(carga <= 50000):
return 18000, 19800
elif(carga <= 200000):
return 9000, 9900
else:
return 3000, 3300
carga = int(input())
auto = autonomia(carga)
ax = float(input())
ay = float(input())
bx = float(input())
by = float(input())
dist = (((bx - ax) ** 2) + ((by... | true | true |
f714b6d7c1ff765f98b7b868c578681f6cd0ca1a | 3,763 | py | Python | hail/python/hail/experimental/export_entries_by_col.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 789 | 2016-09-05T04:14:25.000Z | 2022-03-30T09:51:54.000Z | hail/python/hail/experimental/export_entries_by_col.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 5,724 | 2016-08-29T18:58:40.000Z | 2022-03-31T23:49:42.000Z | hail/python/hail/experimental/export_entries_by_col.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 233 | 2016-08-31T20:42:38.000Z | 2022-02-17T16:42:39.000Z | import hail as hl
from hail.typecheck import typecheck
@typecheck(mt=hl.MatrixTable, path=str, batch_size=int, bgzip=bool, header_json_in_file=bool, use_string_key_as_file_name=bool)
def export_entries_by_col(mt: hl.MatrixTable,
path: str,
batch_size: int = 256,
... | 43.252874 | 145 | 0.577731 | import hail as hl
from hail.typecheck import typecheck
@typecheck(mt=hl.MatrixTable, path=str, batch_size=int, bgzip=bool, header_json_in_file=bool, use_string_key_as_file_name=bool)
def export_entries_by_col(mt: hl.MatrixTable,
path: str,
batch_size: int = 256,
... | true | true |
f714b6dd34948ac4f7a89b22be5b154664dff0b8 | 59 | py | Python | yfm/YahooFetcher/__init__.py | DanielGzgzz/yfMongo | 1ac76c74e7309519d00f0c5205a3581cc6bbfffc | [
"Apache-2.0"
] | 20 | 2017-08-29T22:54:58.000Z | 2022-01-19T03:50:50.000Z | yfm/YahooFetcher/__init__.py | DanielGzgzz/yfMongo | 1ac76c74e7309519d00f0c5205a3581cc6bbfffc | [
"Apache-2.0"
] | 2 | 2020-05-19T14:12:59.000Z | 2022-03-16T05:32:21.000Z | yfm/YahooFetcher/__init__.py | DanielGzgzz/yfMongo | 1ac76c74e7309519d00f0c5205a3581cc6bbfffc | [
"Apache-2.0"
] | 16 | 2017-10-31T09:10:28.000Z | 2022-03-10T19:02:09.000Z | __all__ = ["YahooFetcher", "QueryBuilder"]
from . import *
| 19.666667 | 42 | 0.694915 | __all__ = ["YahooFetcher", "QueryBuilder"]
from . import *
| true | true |
f714b70efde4cdb122c6eb564b9db6f1e30ed059 | 1,062 | py | Python | examples/GB-Halide/ila_spec_a/all.py | pramodsu/ILA-Tools | e76bd90cf356ada8dd6f848fb377f57c83322c71 | [
"MIT"
] | 1 | 2021-11-29T03:51:27.000Z | 2021-11-29T03:51:27.000Z | examples/GB-Halide/ila_spec_a/all.py | pramodsu/ILA-Tools | e76bd90cf356ada8dd6f848fb377f57c83322c71 | [
"MIT"
] | 1 | 2018-06-25T08:49:22.000Z | 2018-06-25T08:49:22.000Z | examples/GB-Halide/ila_spec_a/all.py | pramodsu/ILA-Tools | e76bd90cf356ada8dd6f848fb377f57c83322c71 | [
"MIT"
] | 3 | 2018-06-26T11:31:40.000Z | 2021-12-01T20:16:21.000Z | import ila
from gb_arch import GBArch
from gb_nxt_wri import WRI
from gb_nxt_wr0 import WRU0
from gb_nxt_wr0b import WRU0b
from gb_nxt_wr1 import WRU1
from gb_rdi import defNext as rdDefNext
def defUSts (gb):
m = gb.abst
gb.pre_pix = m.reg ('pre_pix', gb.DATA_SIZE)
gb.pre_pix_nxt = gb.pre_pix
... | 22.595745 | 72 | 0.667608 | import ila
from gb_arch import GBArch
from gb_nxt_wri import WRI
from gb_nxt_wr0 import WRU0
from gb_nxt_wr0b import WRU0b
from gb_nxt_wr1 import WRU1
from gb_rdi import defNext as rdDefNext
def defUSts (gb):
m = gb.abst
gb.pre_pix = m.reg ('pre_pix', gb.DATA_SIZE)
gb.pre_pix_nxt = gb.pre_pix
... | true | true |
f714b773eeecc306dbf5f5429fa3eeef17fbdaba | 58,507 | py | Python | Lib/test/test_xmlrpc.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 953 | 2021-10-08T17:12:34.000Z | 2022-03-31T18:31:50.000Z | Lib/test/test_xmlrpc.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 27 | 2021-10-13T20:54:09.000Z | 2022-03-27T14:41:13.000Z | Lib/test/test_xmlrpc.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 42 | 2021-10-08T16:05:57.000Z | 2022-03-18T13:06:12.000Z | import base64
import datetime
import decimal
import sys
import time
import unittest
from unittest import mock
import xmlrpc.client as xmlrpclib
import xmlrpc.server
import http.client
import http, http.server
import socket
import threading
import re
import io
import contextlib
from test import support
from test.support... | 38.695106 | 87 | 0.617584 | import base64
import datetime
import decimal
import sys
import time
import unittest
from unittest import mock
import xmlrpc.client as xmlrpclib
import xmlrpc.server
import http.client
import http, http.server
import socket
import threading
import re
import io
import contextlib
from test import support
from test.support... | true | true |
f714b9348ad752e793cdd77f438e5175c7c11a35 | 1,235 | py | Python | conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | 113 | 2021-02-15T19:22:36.000Z | 2021-05-07T15:17:42.000Z | conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | __all__ = ['setup_targets']
from pathlib import Path
from typing import Final
from build_system.build_target import *
from build_system.compiler import *
from ..meson import *
def setup_targets(root_dir: Path,
targets: list[CompilerInstanceTargets],
cli_mode: bool) -> None:
f... | 37.424242 | 131 | 0.672065 | __all__ = ['setup_targets']
from pathlib import Path
from typing import Final
from build_system.build_target import *
from build_system.compiler import *
from ..meson import *
def setup_targets(root_dir: Path,
targets: list[CompilerInstanceTargets],
cli_mode: bool) -> None:
f... | true | true |
f714b949926c5c2ca7e179aeb0fa07f4a42d5c12 | 1,552 | py | Python | src/pacsanini/cli/commands.py | Therapixel/pacsanini | 8d8e61601a9df39eaa7aa4b8e9a7e1ccd1ee253d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 10 | 2021-07-05T16:59:03.000Z | 2022-02-09T11:13:03.000Z | src/pacsanini/cli/commands.py | Therapixel/pacsanini | 8d8e61601a9df39eaa7aa4b8e9a7e1ccd1ee253d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 51 | 2021-07-05T08:29:35.000Z | 2021-11-30T08:30:10.000Z | src/pacsanini/cli/commands.py | Therapixel/pacsanini | 8d8e61601a9df39eaa7aa4b8e9a7e1ccd1ee253d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 2 | 2021-07-06T06:35:37.000Z | 2021-07-09T10:26:38.000Z | # Copyright (C) 2019-2020, Therapixel SA.
# All rights reserved.
# This file is subject to the terms and conditions described in the
# LICENSE file distributed in this package.
"""The commands module exposes the different command lines methods
that can be used with pacsanini.
"""
from click import echo, group, option
... | 32.333333 | 88 | 0.794459 |
from click import echo, group, option
from pacsanini.__version__ import __version__
from pacsanini.cli.config import config_cli
from pacsanini.cli.dashboard import dashboard_cli
from pacsanini.cli.db import db_cli_group
from pacsanini.cli.net import echo_cli, find_cli, move_cli, send_cli, server_cli
from pacsanini... | true | true |
f714b953e0c9a6d6462cb48d28e32167397104dc | 9,005 | py | Python | CUB-experiments/nearest_embed.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 5 | 2021-05-23T13:05:45.000Z | 2022-02-13T21:40:59.000Z | CUB-experiments/nearest_embed.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | null | null | null | CUB-experiments/nearest_embed.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 3 | 2021-08-11T03:23:31.000Z | 2021-11-17T01:48:52.000Z | # adapted from https://github.com/nadavbh12/VQ-VAE
import numpy as np
import torch
from torch import nn
from torch.autograd import Function, Variable
import torch.nn.functional as F
from config import *
import pdb
class NearestEmbedFunc(Function):
"""
Input:
------
x - (batch_size, emb_dim, *)
... | 43.713592 | 162 | 0.595447 |
import numpy as np
import torch
from torch import nn
from torch.autograd import Function, Variable
import torch.nn.functional as F
from config import *
import pdb
class NearestEmbedFunc(Function):
@staticmethod
def forward(ctx, input, emb):
emb_ex = emb.expand(... | true | true |
f714ba426a5248f82458ccc103e4f061235d9e45 | 436 | py | Python | venv/Scripts/easy_install-3.6-script.py | ololostapenko/bankera | 5c9093785fa02ef4aa002249ac2ae04a364de44d | [
"Apache-2.0"
] | null | null | null | venv/Scripts/easy_install-3.6-script.py | ololostapenko/bankera | 5c9093785fa02ef4aa002249ac2ae04a364de44d | [
"Apache-2.0"
] | null | null | null | venv/Scripts/easy_install-3.6-script.py | ololostapenko/bankera | 5c9093785fa02ef4aa002249ac2ae04a364de44d | [
"Apache-2.0"
] | null | null | null | #!C:\Devel\Bankera\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==28.8.0','console_scripts','easy_install-3.6'
__requires__ = 'setuptools==28.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.a... | 33.538462 | 87 | 0.683486 |
__requires__ = 'setuptools==28.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==28.8.0', 'console_scripts', 'easy_install-3.6')()
)
| true | true |
f714bd81cb12dc993d3ec9237a0c0ed41807641a | 222 | py | Python | docs/source/working/include/snippets/processes/functions/calcfunction_multiple_outputs.py | pranavmodx/aiida-core | 0edbbf82dfb97ab130914d1674a6f2217eba5971 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | docs/source/working/include/snippets/processes/functions/calcfunction_multiple_outputs.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | docs/source/working/include/snippets/processes/functions/calcfunction_multiple_outputs.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | from aiida.engine import calcfunction
from aiida.orm import Int
@calcfunction
def sum_and_difference(alpha, beta):
return {'sum': alpha + beta, 'difference': alpha - beta}
result = sum_and_difference(Int(1), Int(2))
| 24.666667 | 60 | 0.743243 | from aiida.engine import calcfunction
from aiida.orm import Int
@calcfunction
def sum_and_difference(alpha, beta):
return {'sum': alpha + beta, 'difference': alpha - beta}
result = sum_and_difference(Int(1), Int(2))
| true | true |
f714bdafd960a7b2117b4f5520697b701e88a097 | 10,522 | py | Python | tensorflow_federated/python/research/optimization/stackoverflow/dataset.py | hartmanwilliam/federated | 55e5fcbfde13ac4788f084e4c3c4714130cd19ec | [
"Apache-2.0"
] | 1 | 2020-10-30T10:38:46.000Z | 2020-10-30T10:38:46.000Z | tensorflow_federated/python/research/optimization/stackoverflow/dataset.py | hartmanwilliam/federated | 55e5fcbfde13ac4788f084e4c3c4714130cd19ec | [
"Apache-2.0"
] | 8 | 2019-08-06T06:12:07.000Z | 2019-12-19T02:06:17.000Z | tensorflow_federated/python/research/optimization/stackoverflow/dataset.py | Junyangz/federated | ecf51cdf8b86cbd000f6edc5715dc904bce07540 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# 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 ... | 40.625483 | 80 | 0.720776 |
from typing import List
import numpy as np
import tensorflow as tf
import tensorflow_federated as tff
EVAL_BATCH_SIZE = 100
def create_vocab(vocab_size):
vocab_dict = tff.simulation.datasets.stackoverflow.load_word_counts()
return list(vocab_dict.keys())[:vocab_size]
def split_input_target(chunk... | true | true |
f714bdbc502cd21e6811596121f81b0a678e8f1c | 478 | py | Python | setup.py | danielsiwiec/jetbot | 3b0e57dd1eb3a5d274e7e5bbf0623924e42258b6 | [
"MIT"
] | 5 | 2019-12-09T20:49:59.000Z | 2022-03-10T18:13:23.000Z | setup.py | SnowMasaya/jetbot | 534b7d9b88988b96a228676e2a9f8e92119d86dd | [
"MIT"
] | 4 | 2019-09-23T17:50:31.000Z | 2019-09-23T17:52:35.000Z | setup.py | SnowMasaya/jetbot | 534b7d9b88988b96a228676e2a9f8e92119d86dd | [
"MIT"
] | 8 | 2019-06-09T12:44:10.000Z | 2020-08-31T10:32:14.000Z | import glob
import subprocess
from setuptools import setup, find_packages, Extension
def build_libs():
subprocess.call(['cmake', '.'])
subprocess.call(['make'])
build_libs()
setup(
name='jetbot',
version='0.3.0',
description='An open-source robot based on NVIDIA Jetson Nano',
packages=... | 19.12 | 67 | 0.648536 | import glob
import subprocess
from setuptools import setup, find_packages, Extension
def build_libs():
subprocess.call(['cmake', '.'])
subprocess.call(['make'])
build_libs()
setup(
name='jetbot',
version='0.3.0',
description='An open-source robot based on NVIDIA Jetson Nano',
packages=... | true | true |
f714be8826c14195468efb9f011bb9edd0b15aca | 1,877 | py | Python | viz/scenes/base.py | entzian/spats | cb0d9f1f3c0fbcb3c333096d657ef96f7179de46 | [
"BSL-1.0"
] | 4 | 2016-11-27T04:44:41.000Z | 2019-10-08T18:32:51.000Z | viz/scenes/base.py | entzian/spats | cb0d9f1f3c0fbcb3c333096d657ef96f7179de46 | [
"BSL-1.0"
] | 1 | 2017-12-18T22:02:28.000Z | 2017-12-18T22:02:28.000Z | viz/scenes/base.py | entzian/spats | cb0d9f1f3c0fbcb3c333096d657ef96f7179de46 | [
"BSL-1.0"
] | 3 | 2016-06-10T11:36:00.000Z | 2021-08-30T18:25:18.000Z |
import cjb.uif
from cjb.uif.views import Label
from viz.layout import buttonSize
class BaseScene(cjb.uif.Scene):
def __init__(self, ui, key = None):
self.ui = ui
self.scroller = None
cjb.uif.Scene.__init__(self, ui.manager, key or self.__class__.__name__)
self.container.properti... | 30.274194 | 86 | 0.571124 |
import cjb.uif
from cjb.uif.views import Label
from viz.layout import buttonSize
class BaseScene(cjb.uif.Scene):
def __init__(self, ui, key = None):
self.ui = ui
self.scroller = None
cjb.uif.Scene.__init__(self, ui.manager, key or self.__class__.__name__)
self.container.properti... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.