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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c37e0871074573fc9ba5f909f00cc8a01fee8d8 | 37,881 | py | Python | thespian/system/admin/convention.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 71 | 2020-02-29T12:15:10.000Z | 2022-03-27T01:44:58.000Z | thespian/system/admin/convention.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 14 | 2020-10-07T08:34:29.000Z | 2022-03-27T01:44:41.000Z | thespian/system/admin/convention.py | dendron2000/Thespian | 0acbc5a0803f6d2be3421ea6eb08c6beecbf3802 | [
"MIT"
] | 15 | 2020-05-16T19:44:08.000Z | 2021-11-12T15:42:32.000Z | import logging
from thespian.actors import *
from thespian.system.utilis import (thesplog, checkActorCapabilities,
foldl, join, fmap, AssocList,
actualActorClass)
from thespian.system.timing import ExpirationTimer, currentTime
from thespian.system.... | 46.140073 | 113 | 0.619757 | import logging
from thespian.actors import *
from thespian.system.utilis import (thesplog, checkActorCapabilities,
foldl, join, fmap, AssocList,
actualActorClass)
from thespian.system.timing import ExpirationTimer, currentTime
from thespian.system.... | true | true |
1c37e09718c7c507edb9ccc628e2854c443d122d | 16,098 | py | Python | src/preprocess.py | zliucr/mixed-language-training | d61e767eb470d1f2a2272837bd4daff76c99854f | [
"MIT"
] | 28 | 2019-11-20T05:11:25.000Z | 2022-03-23T07:06:29.000Z | src/preprocess.py | zliucr/mixed-language-training | d61e767eb470d1f2a2272837bd4daff76c99854f | [
"MIT"
] | 5 | 2019-11-28T07:14:01.000Z | 2022-03-23T14:56:52.000Z | src/preprocess.py | zliucr/mixed-language-training | d61e767eb470d1f2a2272837bd4daff76c99854f | [
"MIT"
] | 5 | 2020-01-10T07:40:55.000Z | 2021-05-07T08:09:19.000Z |
from src.preparation import Vocab
from src.utils import binarize_nlu_data
from copy import deepcopy
import codecs
import json
import csv
import re
import string
import os
import pickle
import logging
logger = logging.getLogger()
def load_woz_data(file_path, language, dialogue_ontology, mapping=None):
"""
Th... | 40.651515 | 218 | 0.572742 |
from src.preparation import Vocab
from src.utils import binarize_nlu_data
from copy import deepcopy
import codecs
import json
import csv
import re
import string
import os
import pickle
import logging
logger = logging.getLogger()
def load_woz_data(file_path, language, dialogue_ontology, mapping=None):
with codec... | true | true |
1c37e25defe48454f8d5dd205faca99377110479 | 3,914 | py | Python | BackendBaggie/orders/views.py | Baggie-App/Updateapi | 80f200d7ffd4695e6348ce6bb9a7a31a6b821e77 | [
"MIT"
] | null | null | null | BackendBaggie/orders/views.py | Baggie-App/Updateapi | 80f200d7ffd4695e6348ce6bb9a7a31a6b821e77 | [
"MIT"
] | null | null | null | BackendBaggie/orders/views.py | Baggie-App/Updateapi | 80f200d7ffd4695e6348ce6bb9a7a31a6b821e77 | [
"MIT"
] | null | null | null | from orders.models import Order
from orders.serializers import OrderSerializer
from headers import *
from orders.permissions import CanCreatePermissionforCustomer,CanUpdateDeletePermissionforVendor
from rest_framework.decorators import api_view, permission_classes
#list retrive
class OrderListAPIView(generics.ListAPIV... | 30.578125 | 96 | 0.73071 | from orders.models import Order
from orders.serializers import OrderSerializer
from headers import *
from orders.permissions import CanCreatePermissionforCustomer,CanUpdateDeletePermissionforVendor
from rest_framework.decorators import api_view, permission_classes
class OrderListAPIView(generics.ListAPIView):
__basi... | true | true |
1c37e269d220c97cdae238d11121e1a04f05bdad | 11,267 | py | Python | sklearn/covariance/_empirical_covariance.py | JoElfner/scikit-learn | a538c37de8b7007250a296eddfb3bed6afabd500 | [
"BSD-3-Clause"
] | 1 | 2021-08-28T15:25:32.000Z | 2021-08-28T15:25:32.000Z | sklearn/covariance/_empirical_covariance.py | JoElfner/scikit-learn | a538c37de8b7007250a296eddfb3bed6afabd500 | [
"BSD-3-Clause"
] | null | null | null | sklearn/covariance/_empirical_covariance.py | JoElfner/scikit-learn | a538c37de8b7007250a296eddfb3bed6afabd500 | [
"BSD-3-Clause"
] | null | null | null | """
Maximum likelihood covariance estimator.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
# avoid division truncation
import warnings
import numpy as np
from scipy... | 33.041056 | 86 | 0.618088 |
import warnings
import numpy as np
from scipy import linalg
from .. import config_context
from ..base import BaseEstimator
from ..utils import check_array
from ..utils.extmath import fast_logdet
from ..metrics.pairwise import pairwise_distances
def log_likelihood(emp_cov, precision):
p = precision.shape[0]
... | true | true |
1c37e32bb445597a71ec273a75c015e77f9ac6e5 | 1,805 | py | Python | week05/Polynomials/polynomials.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | 4 | 2019-04-06T20:06:19.000Z | 2020-03-31T20:51:56.000Z | week05/Polynomials/polynomials.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | null | null | null | week05/Polynomials/polynomials.py | PreslavaKuzova/Python101 | 716cdd2d818f7eef45a1cdafdfb85a208daec750 | [
"MIT"
] | 1 | 2020-03-21T00:49:56.000Z | 2020-03-21T00:49:56.000Z | import sys
import re
class Monomial:
def __init__ (self, coefficient, power):
self.coefficient = coefficient
self.power = power
def calculate_derivative(self):
if self.power is not 0:
self.coefficient *= self.power
self.power -=1
if self.power == 0:
... | 31.12069 | 78 | 0.582271 | import sys
import re
class Monomial:
def __init__ (self, coefficient, power):
self.coefficient = coefficient
self.power = power
def calculate_derivative(self):
if self.power is not 0:
self.coefficient *= self.power
self.power -=1
if self.power == 0:
... | true | true |
1c37e36d659e4ac0d6d14021d0084265390a4ba3 | 1,309 | py | Python | minotor/api/projection_handler.py | datarmada/minotor | 06079926d717f0cd882152319aaeaa7edc9ba087 | [
"Apache-2.0"
] | 25 | 2020-04-11T17:51:31.000Z | 2022-03-21T16:26:36.000Z | minotor/api/projection_handler.py | datarmada/minotor | 06079926d717f0cd882152319aaeaa7edc9ba087 | [
"Apache-2.0"
] | 1 | 2022-02-28T04:07:01.000Z | 2022-02-28T04:07:01.000Z | minotor/api/projection_handler.py | datarmada/minotor | 06079926d717f0cd882152319aaeaa7edc9ba087 | [
"Apache-2.0"
] | null | null | null | import json
from tornado.escape import json_decode
from minotor.api.base_route import BaseRouteHandler
from minotor.encoders.json_encoder import ExtendedJSONEncoder
from minotor.data_managers.file_manager import FileManager
from minotor.statistics.projection import tsne_projector
class ProjectionHandler(BaseRouteHa... | 42.225806 | 110 | 0.663102 | import json
from tornado.escape import json_decode
from minotor.api.base_route import BaseRouteHandler
from minotor.encoders.json_encoder import ExtendedJSONEncoder
from minotor.data_managers.file_manager import FileManager
from minotor.statistics.projection import tsne_projector
class ProjectionHandler(BaseRouteHa... | true | true |
1c37e44056c8c8b12c54964949ff53fff6f44914 | 2,089 | py | Python | scripts/plotting/generate_table.py | ltiao/gp-dre | 5997a74826636a58662f5fa8c41a81d32ba8baa2 | [
"MIT"
] | null | null | null | scripts/plotting/generate_table.py | ltiao/gp-dre | 5997a74826636a58662f5fa8c41a81d32ba8baa2 | [
"MIT"
] | null | null | null | scripts/plotting/generate_table.py | ltiao/gp-dre | 5997a74826636a58662f5fa8c41a81d32ba8baa2 | [
"MIT"
] | 1 | 2021-11-10T00:52:11.000Z | 2021-11-10T00:52:11.000Z | import sys
import click
import pandas as pd
from conf import DATASET_PRETTY_NAMES, WEIGHT_PRETTY_NAMES
@click.command()
@click.argument("result", type=click.File('r'))
@click.argument("table", type=click.File('w'))
@click.option("--value", '-v', default="error")
@click.option("--index", '-i', default="name")
@click.... | 34.245902 | 83 | 0.618478 | import sys
import click
import pandas as pd
from conf import DATASET_PRETTY_NAMES, WEIGHT_PRETTY_NAMES
@click.command()
@click.argument("result", type=click.File('r'))
@click.argument("table", type=click.File('w'))
@click.option("--value", '-v', default="error")
@click.option("--index", '-i', default="name")
@click.... | true | true |
1c37e476eddadb3396d556671bb19e9bf56f2822 | 10,216 | py | Python | scripts/comparer.py | Chenger1/stellaris-trpack | 5d85bbbc7374975b5da729899b5691ea77c16ea2 | [
"MIT"
] | 3 | 2020-07-23T00:32:06.000Z | 2020-10-09T18:05:56.000Z | scripts/comparer.py | Chenger1/stellaris-trpack | 5d85bbbc7374975b5da729899b5691ea77c16ea2 | [
"MIT"
] | 105 | 2020-07-16T12:23:57.000Z | 2021-01-18T18:11:40.000Z | scripts/comparer.py | Chenger1/stellaris-trpack | 5d85bbbc7374975b5da729899b5691ea77c16ea2 | [
"MIT"
] | 1 | 2020-07-15T13:30:57.000Z | 2020-07-15T13:30:57.000Z | """
↓ Инициализация данных ↓
"""
from os import path, mkdir
from scripts.utils import local_mod_path
from copy import copy
from typing import Union, Tuple
from scripts.stack import Stack, NameListElement, LastParentStack
"""
↓ Сохранение завершенной локали... | 42.74477 | 121 | 0.532792 |
from os import path, mkdir
from scripts.utils import local_mod_path
from copy import copy
from typing import Union, Tuple
from scripts.stack import Stack, NameListElement, LastParentStack
def put_lines(file):
localisation_path_list = file.original_file_path.split(f'{file.mod_id}\\')[-1].split('\\')[0:-2]
... | true | true |
1c37e4a671bc325ced27e030ace6a98fc1bdd59e | 3,559 | py | Python | tensorflow/examples/get_started/regression/test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/examples/get_started/regression/test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/examples/get_started/regression/test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2016 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... | 39.544444 | 138 | 0.744591 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import pandas as pd
from six.moves import StringIO
import tensorflow.examples.get_started.regression.imports85 as imports85
sys.modules["imports85"] = imports85
import tensorflow.data as data
... | true | true |
1c37e5fbdebd8e4a3070648f16226aee72a79b2f | 974 | py | Python | guild/commands/remotes.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | null | null | null | guild/commands/remotes.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | null | null | null | guild/commands/remotes.py | msarahan/guildai | 99bdd09683291dbc206b6dde1b327d47401d29eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2022 TensorHub, 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 writ... | 24.974359 | 74 | 0.755647 |
from __future__ import absolute_import
from __future__ import division
import click
from guild import click_util
from . import remote_support
@click.command()
@click_util.render_doc
def remotes():
from . import remotes_impl
remotes_impl.main()
| true | true |
1c37e7dbb021610a7eec1d4cac9335f3331d5cf7 | 79 | py | Python | py-work/pipeline/tokenizer.py | msaidzengin/KontroleDegerMi | a14799e1076e018872d09e449c991ce3548a56cd | [
"Apache-2.0"
] | 3 | 2019-11-18T12:34:37.000Z | 2021-02-28T21:37:42.000Z | py-work/pipeline/tokenizer.py | msaidzengin/KontroleDegerMi | a14799e1076e018872d09e449c991ce3548a56cd | [
"Apache-2.0"
] | null | null | null | py-work/pipeline/tokenizer.py | msaidzengin/KontroleDegerMi | a14799e1076e018872d09e449c991ce3548a56cd | [
"Apache-2.0"
] | 3 | 2019-09-15T13:44:19.000Z | 2020-02-04T16:06:23.000Z | import nltk
def tokenize(text):
return nltk.word_tokenize(text, 'turkish') | 19.75 | 46 | 0.746835 | import nltk
def tokenize(text):
return nltk.word_tokenize(text, 'turkish') | true | true |
1c37e8e92759ddc834020ce00cb744fd0f0d2997 | 28,407 | py | Python | dowhy/causal_refuters/dummy_outcome_refuter.py | t-triobox/dowhy | 77906cd4edff2749683eb4b2f1ab91213e38ec9c | [
"MIT"
] | 840 | 2018-06-25T22:31:16.000Z | 2019-05-06T13:45:17.000Z | dowhy/causal_refuters/dummy_outcome_refuter.py | t-triobox/dowhy | 77906cd4edff2749683eb4b2f1ab91213e38ec9c | [
"MIT"
] | 51 | 2018-07-05T09:31:59.000Z | 2019-05-03T15:37:10.000Z | dowhy/causal_refuters/dummy_outcome_refuter.py | t-triobox/dowhy | 77906cd4edff2749683eb4b2f1ab91213e38ec9c | [
"MIT"
] | 106 | 2018-06-28T12:35:03.000Z | 2019-05-06T16:16:32.000Z | import copy
import math
import numpy as np
import pandas as pd
import logging
import pdb
from collections import OrderedDict, namedtuple
from dowhy.causal_refuter import CausalRefutation
from dowhy.causal_refuter import CausalRefuter
from dowhy.causal_estimator import CausalEstimator,CausalEstimate
from sklearn.linear... | 47.662752 | 196 | 0.655824 | import copy
import math
import numpy as np
import pandas as pd
import logging
import pdb
from collections import OrderedDict, namedtuple
from dowhy.causal_refuter import CausalRefutation
from dowhy.causal_refuter import CausalRefuter
from dowhy.causal_estimator import CausalEstimator,CausalEstimate
from sklearn.linear... | true | true |
1c37e949e26182a0b9e6fe6ac19d70d6b2de2d73 | 2,968 | py | Python | configs/vfnet/vfnet_r2_101_fpn_mdconv_c3-c5_mstrain_2x_coco_cate3.py | hanchenchen/VarifocalNet | 78bcdf6877db8a8ddbd71ae92c38a976ad1fc704 | [
"Apache-2.0"
] | null | null | null | configs/vfnet/vfnet_r2_101_fpn_mdconv_c3-c5_mstrain_2x_coco_cate3.py | hanchenchen/VarifocalNet | 78bcdf6877db8a8ddbd71ae92c38a976ad1fc704 | [
"Apache-2.0"
] | null | null | null | configs/vfnet/vfnet_r2_101_fpn_mdconv_c3-c5_mstrain_2x_coco_cate3.py | hanchenchen/VarifocalNet | 78bcdf6877db8a8ddbd71ae92c38a976ad1fc704 | [
"Apache-2.0"
] | null | null | null | _base_ = './vfnet_r50_fpn_mdconv_c3-c5_mstrain_2x_coco.py'
model = dict(
pretrained='open-mmlab://res2net101_v1d_26w_4s',
backbone=dict(
type='Res2Net',
depth=101,
scales=4,
base_width=26,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
no... | 31.913978 | 94 | 0.62938 | _base_ = './vfnet_r50_fpn_mdconv_c3-c5_mstrain_2x_coco.py'
model = dict(
pretrained='open-mmlab://res2net101_v1d_26w_4s',
backbone=dict(
type='Res2Net',
depth=101,
scales=4,
base_width=26,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
no... | true | true |
1c37e9ac7fc3e709da3c94c51fd907c758367913 | 4,116 | py | Python | getCmpLogicMasking.py | DependableSystemsLab/GPU-Trident | c734cd8a18146869fc915af73a6ca13ceca35c0b | [
"MIT"
] | 1 | 2021-01-17T10:36:21.000Z | 2021-01-17T10:36:21.000Z | getCmpLogicMasking.py | DependableSystemsLab/GPU-Trident | c734cd8a18146869fc915af73a6ca13ceca35c0b | [
"MIT"
] | null | null | null | getCmpLogicMasking.py | DependableSystemsLab/GPU-Trident | c734cd8a18146869fc915af73a6ca13ceca35c0b | [
"MIT"
] | null | null | null | #! /usr/bin/python
import subprocess, os, sys
####################################################################
src_name = sys.argv[1]
targetCmpIndex = int(sys.argv[2])
####################################################################
ltCmpList = []
storeMaskingMap = {}
if_cmp = False
# Read "loop_terminatin... | 28.583333 | 219 | 0.608844 |
import subprocess, os, sys
src_name = sys.argv[1]
targetCmpIndex = int(sys.argv[2])
ltCmpList = []
storeMaskingMap = {}
if_cmp = False
with open("results/loop_terminating_cmp_list.txt", 'r') as lf:
ltLines = lf.readlines()
for ltLine in ltLines:
ltIndex = int( ltLine.split(" ")[1].replace("\n", "")... | true | true |
1c37e9f73a9218b7227d08cc2e8341fe3692bd34 | 1,461 | py | Python | mandos/search/pubchem/dgidb_search.py | dmyersturnbull/chembler | b1b54a5f4fe7939e012c0cc8b227fcea60d6e744 | [
"Apache-2.0"
] | null | null | null | mandos/search/pubchem/dgidb_search.py | dmyersturnbull/chembler | b1b54a5f4fe7939e012c0cc8b227fcea60d6e744 | [
"Apache-2.0"
] | null | null | null | mandos/search/pubchem/dgidb_search.py | dmyersturnbull/chembler | b1b54a5f4fe7939e012c0cc8b227fcea60d6e744 | [
"Apache-2.0"
] | null | null | null | from typing import Sequence
from mandos.model.apis.pubchem_api import PubchemApi
from mandos.model.concrete_hits import DgiHit
from mandos.search.pubchem import PubchemSearch
class DgiSearch(PubchemSearch[DgiHit]):
""" """
def __init__(self, key: str, api: PubchemApi):
super().__init__(key, api)
... | 34.785714 | 85 | 0.559206 | from typing import Sequence
from mandos.model.apis.pubchem_api import PubchemApi
from mandos.model.concrete_hits import DgiHit
from mandos.search.pubchem import PubchemSearch
class DgiSearch(PubchemSearch[DgiHit]):
def __init__(self, key: str, api: PubchemApi):
super().__init__(key, api)
def find(s... | true | true |
1c37ec9fe6825cc352f2e173037d792b57bbdcde | 12,606 | py | Python | mapclientplugins/scaffoldrigidalignerstep/view/scaffoldrigidalignerwidget.py | mahyar-osn/mapclientplugins.scaffoldrigidalignerstep | 7c5fd754fba4778e59a743ea03c47c920df26827 | [
"Apache-2.0"
] | null | null | null | mapclientplugins/scaffoldrigidalignerstep/view/scaffoldrigidalignerwidget.py | mahyar-osn/mapclientplugins.scaffoldrigidalignerstep | 7c5fd754fba4778e59a743ea03c47c920df26827 | [
"Apache-2.0"
] | null | null | null | mapclientplugins/scaffoldrigidalignerstep/view/scaffoldrigidalignerwidget.py | mahyar-osn/mapclientplugins.scaffoldrigidalignerstep | 7c5fd754fba4778e59a743ea03c47c920df26827 | [
"Apache-2.0"
] | null | null | null | from PySide import QtGui
from .ui_scaffoldrigidalignerwidget import Ui_ScaffoldRigidAlignerWidget
from opencmiss.zinchandlers.scenemanipulation import SceneManipulation
from opencmiss.zincwidgets.basesceneviewerwidget import BaseSceneviewerWidget
class ScaffoldRigidAlignerWidget(QtGui.QWidget):
def __init__(se... | 41.741722 | 103 | 0.698398 | from PySide import QtGui
from .ui_scaffoldrigidalignerwidget import Ui_ScaffoldRigidAlignerWidget
from opencmiss.zinchandlers.scenemanipulation import SceneManipulation
from opencmiss.zincwidgets.basesceneviewerwidget import BaseSceneviewerWidget
class ScaffoldRigidAlignerWidget(QtGui.QWidget):
def __init__(se... | true | true |
1c37ed23465942e2c0de741b7ff5ccc1455f86ac | 7,281 | py | Python | imgHide++/imghide++.py | AJD-/Stego-Examples | 26bc9b1c1bf2d52c96818eaf10e07ed2111d47f9 | [
"Apache-2.0"
] | null | null | null | imgHide++/imghide++.py | AJD-/Stego-Examples | 26bc9b1c1bf2d52c96818eaf10e07ed2111d47f9 | [
"Apache-2.0"
] | null | null | null | imgHide++/imghide++.py | AJD-/Stego-Examples | 26bc9b1c1bf2d52c96818eaf10e07ed2111d47f9 | [
"Apache-2.0"
] | null | null | null | from PIL import Image
import sys
import os
import random
import math
import secrets
from base64 import b64encode
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from bitstring import BitArray
def main():
global maxLenChar, maxLenBits
# Clear screen lambda function
cls = lambda: os.system(... | 37.530928 | 139 | 0.514352 | from PIL import Image
import sys
import os
import random
import math
import secrets
from base64 import b64encode
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from bitstring import BitArray
def main():
global maxLenChar, maxLenBits
cls = lambda: os.system('cls' if os.name=='nt' else 'cl... | true | true |
1c37edc31b7975955d1a8b592b54e5c555a2a1e0 | 357 | py | Python | tests/test013.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 739 | 2015-01-01T02:05:11.000Z | 2022-03-30T15:26:16.000Z | tests/test013.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 33 | 2015-03-25T23:17:04.000Z | 2021-08-19T08:25:22.000Z | tests/test013.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 167 | 2015-01-01T22:27:47.000Z | 2022-03-17T13:29:19.000Z | import DOM
class FocusWidget:
def __init__(self, element):
self.clickListeners = []
def addClickListener(self, listener):
self.clickListeners.append(listener)
def onBrowserEvent(self, event):
if DOM.eventGetType(event) == Event.ONCLICK:
for listener in self.clickListe... | 23.8 | 52 | 0.647059 | import DOM
class FocusWidget:
def __init__(self, element):
self.clickListeners = []
def addClickListener(self, listener):
self.clickListeners.append(listener)
def onBrowserEvent(self, event):
if DOM.eventGetType(event) == Event.ONCLICK:
for listener in self.clickListe... | true | true |
1c37eeee313d0653cf6b114df974b6e4a57dcf65 | 3,020 | py | Python | beep/tests/test_principal_components.py | moorepatrick/beep | c54b80d1afb5b175bd9335481efc2474a4317c47 | [
"Apache-2.0"
] | 17 | 2020-06-23T17:39:29.000Z | 2022-02-20T07:39:34.000Z | beep/tests/test_principal_components.py | moorepatrick/beep | c54b80d1afb5b175bd9335481efc2474a4317c47 | [
"Apache-2.0"
] | null | null | null | beep/tests/test_principal_components.py | moorepatrick/beep | c54b80d1afb5b175bd9335481efc2474a4317c47 | [
"Apache-2.0"
] | 5 | 2020-07-24T13:12:06.000Z | 2022-03-07T05:53:29.000Z | # Copyright 2019 Toyota Research Institute. All rights reserved.
import json
import os
import unittest
import numpy as np
from sklearn.decomposition import PCA
from beep.principal_components import PrincipalComponents, pivot_data
TEST_DIR = os.path.dirname(__file__)
TEST_FILE_DIR = os.path.join(TEST_DIR, "test_files")... | 39.736842 | 109 | 0.679801 | import json
import os
import unittest
import numpy as np
from sklearn.decomposition import PCA
from beep.principal_components import PrincipalComponents, pivot_data
TEST_DIR = os.path.dirname(__file__)
TEST_FILE_DIR = os.path.join(TEST_DIR, "test_files")
class PrincipalComponentsTest(unittest.TestCase):
def setU... | true | true |
1c37eefef7e9572a00fb3c774e3540d8b35ceb83 | 7,449 | py | Python | Projects/1_Sudoku/solution.py | aanzolaavila/aind-projects | 3b1a1f6e0199dc6033b2183f25afb456e53751ce | [
"MIT"
] | null | null | null | Projects/1_Sudoku/solution.py | aanzolaavila/aind-projects | 3b1a1f6e0199dc6033b2183f25afb456e53751ce | [
"MIT"
] | null | null | null | Projects/1_Sudoku/solution.py | aanzolaavila/aind-projects | 3b1a1f6e0199dc6033b2183f25afb456e53751ce | [
"MIT"
] | null | null | null | import copy
from utils import *
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC', 'DEF', 'GHI') for cs in ('123', '456', '789')]
unitlist = row_units + column_units + square_units
diagonal_units = [[a + b for a, b in zip('ABCDEFGHI... | 32.246753 | 113 | 0.645322 | import copy
from utils import *
row_units = [cross(r, cols) for r in rows]
column_units = [cross(rows, c) for c in cols]
square_units = [cross(rs, cs) for rs in ('ABC', 'DEF', 'GHI') for cs in ('123', '456', '789')]
unitlist = row_units + column_units + square_units
diagonal_units = [[a + b for a, b in zip('ABCDEFGHI... | true | true |
1c37f02e47f46e95b61c313a193b703b8bc6a892 | 2,212 | py | Python | mmedit/datasets/sr_facial_landmark_dataset.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 1 | 2021-07-20T08:20:04.000Z | 2021-07-20T08:20:04.000Z | mmedit/datasets/sr_facial_landmark_dataset.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 1 | 2021-08-05T16:20:39.000Z | 2021-08-05T16:20:39.000Z | mmedit/datasets/sr_facial_landmark_dataset.py | ChenShuwei1001/mmediting | 285e629fe9da8a13c7538a6bb3347e8870cd7201 | [
"Apache-2.0"
] | 2 | 2021-12-26T16:23:09.000Z | 2021-12-28T03:44:10.000Z | import os.path as osp
import numpy as np
from .base_sr_dataset import BaseSRDataset
from .registry import DATASETS
@DATASETS.register_module()
class SRFacialLandmarkDataset(BaseSRDataset):
"""Facial image and landmark dataset with an annotation file for image
restoration.
The dataset loads gt (Ground-T... | 34.5625 | 78 | 0.651899 | import os.path as osp
import numpy as np
from .base_sr_dataset import BaseSRDataset
from .registry import DATASETS
@DATASETS.register_module()
class SRFacialLandmarkDataset(BaseSRDataset):
def __init__(self, gt_folder, ann_file, pipeline, scale, test_mode=False):
super().__init__(pipeline, scale, test_... | true | true |
1c37f0cd29bf48ab95bf22b437e1c701e9ac98d4 | 195 | py | Python | scripts/deploy_counter.py | PatrickAlphaC/xDai-brownie | 91e50772716fe349cc15645450af5c1ed9bf1d55 | [
"MIT"
] | 2 | 2021-02-25T23:12:40.000Z | 2021-03-17T19:55:07.000Z | scripts/deploy_counter.py | PatrickAlphaC/xDai-brownie | 91e50772716fe349cc15645450af5c1ed9bf1d55 | [
"MIT"
] | null | null | null | scripts/deploy_counter.py | PatrickAlphaC/xDai-brownie | 91e50772716fe349cc15645450af5c1ed9bf1d55 | [
"MIT"
] | 2 | 2021-01-19T08:53:14.000Z | 2021-04-12T08:36:20.000Z | #!/usr/bin/python3
import os
from brownie import Counter, accounts, config
def main():
dev = accounts.add(os.getenv(config['wallets']['from_key']))
return Counter.deploy({'from': dev})
| 21.666667 | 64 | 0.692308 | import os
from brownie import Counter, accounts, config
def main():
dev = accounts.add(os.getenv(config['wallets']['from_key']))
return Counter.deploy({'from': dev})
| true | true |
1c37f13b750016fa9c175946d0bdb07a2c1b3a89 | 3,873 | py | Python | vk_bot.py | aevtikheev/quiz_bot | 2d2909736775afb4493cd0640cf27f40f89fe9f3 | [
"MIT"
] | null | null | null | vk_bot.py | aevtikheev/quiz_bot | 2d2909736775afb4493cd0640cf27f40f89fe9f3 | [
"MIT"
] | null | null | null | vk_bot.py | aevtikheev/quiz_bot | 2d2909736775afb4493cd0640cf27f40f89fe9f3 | [
"MIT"
] | null | null | null | """VK version of Quiz Bot."""
from redis import Redis
from vk_api import VkApi
from vk_api.longpoll import VkLongPoll, VkEventType, Event
from vk_api.vk_api import VkApiMethod
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from env_settings import env_settings
from quest... | 33.973684 | 97 | 0.696101 | from redis import Redis
from vk_api import VkApi
from vk_api.longpoll import VkLongPoll, VkEventType, Event
from vk_api.vk_api import VkApiMethod
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from vk_api.utils import get_random_id
from env_settings import env_settings
from questions import QuizDB, is_correct... | true | true |
1c37f1af7831898bfa93304aca25edbefa2bf539 | 1,175 | py | Python | gumroad_clone/users/tests/test_forms.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | 1 | 2022-01-22T13:43:30.000Z | 2022-01-22T13:43:30.000Z | gumroad_clone/users/tests/test_forms.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | gumroad_clone/users/tests/test_forms.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | """
Module for all Form Tests.
"""
import pytest
from django.utils.translation import gettext_lazy as _
from gumroad_clone.users.forms import UserCreationForm
from gumroad_clone.users.models import User
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
"""
Test class for all tests related to th... | 29.375 | 87 | 0.63234 | import pytest
from django.utils.translation import gettext_lazy as _
from gumroad_clone.users.forms import UserCreationForm
from gumroad_clone.users.models import User
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_username_validation_error_msg(self, user: User):
... | true | true |
1c37f1ceed2be005d0a908561228e8a8a445d658 | 3,311 | py | Python | rover/ball_tracking.py | pvrohin/Rover | 7b84aec32b38cff273c6174872ecf3344d7d1919 | [
"MIT"
] | null | null | null | rover/ball_tracking.py | pvrohin/Rover | 7b84aec32b38cff273c6174872ecf3344d7d1919 | [
"MIT"
] | null | null | null | rover/ball_tracking.py | pvrohin/Rover | 7b84aec32b38cff273c6174872ecf3344d7d1919 | [
"MIT"
] | null | null | null | # USAGE
# python ball_tracking.py --video ball_tracking_example.mp4
# python ball_tracking.py
# import the necessary packages
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument... | 29.5625 | 105 | 0.700091 |
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video",
help="path to the (optional) video file")
ap.add_argument("-b", "--buffer", type=int, default=64,
help="max buffer size")
args = vars(ap.parse_args())
greenLowe... | true | true |
1c37f2a6a12804c5bbbf6556acc243bbfee5de70 | 6,282 | py | Python | ics/structures/st_chip_versions.py | intrepidcs/python_ics | 7bfa8c2f893763608f9255f9536a2019cfae0c23 | [
"Unlicense"
] | 45 | 2017-10-17T08:42:08.000Z | 2022-02-21T16:26:48.000Z | ics/structures/st_chip_versions.py | intrepidcs/python_ics | 7bfa8c2f893763608f9255f9536a2019cfae0c23 | [
"Unlicense"
] | 106 | 2017-03-07T21:10:39.000Z | 2022-03-29T15:32:46.000Z | ics/structures/st_chip_versions.py | intrepidcs/python_ics | 7bfa8c2f893763608f9255f9536a2019cfae0c23 | [
"Unlicense"
] | 17 | 2017-04-04T12:30:22.000Z | 2022-01-28T05:30:25.000Z | # This file was auto generated; Do not modify, if you value your sanity!
import ctypes
import enum
class fire_versions(ctypes.Structure):
_pack_ = 2
_fields_ = [
('mpic_maj', ctypes.c_uint8),
('mpic_min', ctypes.c_uint8),
('upic_maj', ctypes.c_uint8),
('upic_min', ctypes.c_uin... | 22.76087 | 72 | 0.622254 | import ctypes
import enum
class fire_versions(ctypes.Structure):
_pack_ = 2
_fields_ = [
('mpic_maj', ctypes.c_uint8),
('mpic_min', ctypes.c_uint8),
('upic_maj', ctypes.c_uint8),
('upic_min', ctypes.c_uint8),
('lpic_maj', ctypes.c_uint8),
('lpic_min', ctypes.c_... | true | true |
1c37f4307c1fedd80d147e00179c58c2aeb6612a | 3,496 | py | Python | python/assign_user_to_org_role.py | stevenctong/rubrik | 89e20799a998943811db615ad49f64a26929f423 | [
"MIT"
] | 4 | 2020-12-31T21:53:53.000Z | 2022-03-24T03:02:25.000Z | python/assign_user_to_org_role.py | stevenctong/rubrik | 89e20799a998943811db615ad49f64a26929f423 | [
"MIT"
] | null | null | null | python/assign_user_to_org_role.py | stevenctong/rubrik | 89e20799a998943811db615ad49f64a26929f423 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# https://build.rubrik.com
# https://github.com/rubrikinc/rubrik-sdk-for-python
# Title: assign_user_to_org_role.py
# Description: Assigns a Rubrik user to an organization role
# Author: Steven Tong
# GitHub: stevenctong
# Date: 5/4/21
import rubrik_cdm
import urllib3
# Use to import Rubrik lo... | 32.37037 | 110 | 0.69365 |
import rubrik_cdm
import urllib3
urllib3.disable_warnings()
node_ip = ""
username = ""
password = ""
username = ""
org_name = ""
org_role = ""
rubrik = rubrik_cdm.Connect(node_ip, username, password)
ldap_service = rubrik.get('v1', '/ldap_service')
ldap_data = ldap_service['data']
username_split = username.spl... | true | true |
1c37f4d127a520e1151bfd13ef3e22bfa8b4283d | 1,120 | py | Python | lib/atari/state_processor.py | Edadeal/deephack-rl | 86f13be19f5650b9acc9dd3b82ea5637418c7ad3 | [
"MIT"
] | null | null | null | lib/atari/state_processor.py | Edadeal/deephack-rl | 86f13be19f5650b9acc9dd3b82ea5637418c7ad3 | [
"MIT"
] | null | null | null | lib/atari/state_processor.py | Edadeal/deephack-rl | 86f13be19f5650b9acc9dd3b82ea5637418c7ad3 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
class StateProcessor():
"""
Processes a raw Atari iamges. Resizes it and converts it to grayscale.
"""
def __init__(self):
# Build the Tensorflow graph
with tf.variable_scope("state_processor"):
self.input_state = tf.placeholder(
... | 33.939394 | 85 | 0.599107 | import numpy as np
import tensorflow as tf
class StateProcessor():
def __init__(self):
with tf.variable_scope("state_processor"):
self.input_state = tf.placeholder(
shape=[210, 160, 3], dtype=tf.uint8)
self.output = tf.image.rgb_to_grayscale(self.input_stat... | true | true |
1c37f5c549e1dac8ea0ba970954be03eefadf2ed | 2,070 | py | Python | mesonbuild/scripts/commandrunner.py | NNemec/meson | d72a5c14f83253bafaf6b2531442d981ea1df2ed | [
"Apache-2.0"
] | 1 | 2019-08-16T16:25:12.000Z | 2019-08-16T16:25:12.000Z | mesonbuild/scripts/commandrunner.py | NNemec/meson | d72a5c14f83253bafaf6b2531442d981ea1df2ed | [
"Apache-2.0"
] | null | null | null | mesonbuild/scripts/commandrunner.py | NNemec/meson | d72a5c14f83253bafaf6b2531442d981ea1df2ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2014 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by appl... | 34.5 | 89 | 0.68744 |
import sys, os, subprocess, shutil
def run_command(source_dir, build_dir, subdir, command, arguments):
env = {'MESON_SOURCE_ROOT' : source_dir,
'MESON_BUILD_ROOT' : build_dir,
'MESON_SUBDIR' : subdir
}
cwd = os.path.join(source_dir, subdir)
child_env = os.environ.copy(... | true | true |
1c37f68eba5826067ac62bbbd368c2e6261a9be9 | 1,400 | py | Python | surveytools/__init__.py | barentsen/vphastools | 214ddea35d2628034c236c5647a977fc2bad6572 | [
"MIT"
] | null | null | null | surveytools/__init__.py | barentsen/vphastools | 214ddea35d2628034c236c5647a977fc2bad6572 | [
"MIT"
] | 8 | 2015-05-18T16:31:28.000Z | 2017-10-17T05:25:37.000Z | surveytools/__init__.py | barentsen/vphastools | 214ddea35d2628034c236c5647a977fc2bad6572 | [
"MIT"
] | 4 | 2016-05-13T14:23:25.000Z | 2019-12-02T05:13:58.000Z | from __future__ import absolute_import
import os
# Use Agg if no DISPLAY is available
DISPLAY = os.environ.get('DISPLAY')
if DISPLAY is None or DISPLAY.startswith('localhost'):
import matplotlib
matplotlib.use('Agg')
###########
# CONSTANTS
###########
# Where are VPHAS reduced images and calibration frames... | 35 | 74 | 0.668571 | from __future__ import absolute_import
import os
DISPLAY = os.environ.get('DISPLAY')
if DISPLAY is None or DISPLAY.startswith('localhost'):
import matplotlib
matplotlib.use('Agg')
VPHAS_DATA_PATH = '/home/gb/tmp/vphasdisk'
VPHAS_PIXEL_SCALE = 0.213 VPHAS_BANDS = ['u', 'g', 'r2', 'ha', 'r', 'i']
SURVEYTOOL... | true | true |
1c37f6d5759aa1b5897ab68580f514851e24c730 | 13,776 | py | Python | checker.py | EmiliaDevs/HotstarChecker | 9935ec45edc365e91840ad581560be64f35a6f8c | [
"MIT"
] | 9 | 2021-03-07T14:36:22.000Z | 2021-08-02T16:32:43.000Z | checker.py | Keys-007/HotstarChecker | 9935ec45edc365e91840ad581560be64f35a6f8c | [
"MIT"
] | null | null | null | checker.py | Keys-007/HotstarChecker | 9935ec45edc365e91840ad581560be64f35a6f8c | [
"MIT"
] | 7 | 2021-03-07T14:39:35.000Z | 2022-01-22T16:28:18.000Z | import requests
import json
import re
import sys
import os
import asyncio
from io import BytesIO
from pyrogram import Client, filters, idle
from pyrogram import __version__
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
from pyrogram.errors import UserNotParticipant, FloodWait, ChatAdmi... | 49.376344 | 248 | 0.551394 | import requests
import json
import re
import sys
import os
import asyncio
from io import BytesIO
from pyrogram import Client, filters, idle
from pyrogram import __version__
from pyrogram.types import Message, InlineKeyboardButton, InlineKeyboardMarkup
from pyrogram.errors import UserNotParticipant, FloodWait, ChatAdmi... | true | true |
1c37f76343bf1d2e443bbd7dd15abdfcf9663879 | 482 | py | Python | cbuild/hooks/pre_configure/01_override_guess.py | wezm/cports | 0d901c424cbcd663b6d0a2ce9803143a63db40b5 | [
"BSD-2-Clause"
] | null | null | null | cbuild/hooks/pre_configure/01_override_guess.py | wezm/cports | 0d901c424cbcd663b6d0a2ce9803143a63db40b5 | [
"BSD-2-Clause"
] | null | null | null | cbuild/hooks/pre_configure/01_override_guess.py | wezm/cports | 0d901c424cbcd663b6d0a2ce9803143a63db40b5 | [
"BSD-2-Clause"
] | null | null | null | from cbuild.core import paths
import shutil
def invoke(pkg):
if not pkg.build_style or pkg.build_style != "gnu_configure":
return
for f in pkg.abs_wrksrc.rglob("*config*.*"):
if f.is_symlink():
continue
if f.suffix == ".guess":
f.unlink()
shutil.cop... | 26.777778 | 65 | 0.556017 | from cbuild.core import paths
import shutil
def invoke(pkg):
if not pkg.build_style or pkg.build_style != "gnu_configure":
return
for f in pkg.abs_wrksrc.rglob("*config*.*"):
if f.is_symlink():
continue
if f.suffix == ".guess":
f.unlink()
shutil.cop... | true | true |
1c37f7731e03aa6c8b5e3fdf43dcb61912bc9bdb | 10,571 | py | Python | neural/models.py | ipavlopoulos/lm | b9ad7d98be47c0f1a6b446a090d1fce488bb2e3f | [
"Apache-2.0"
] | null | null | null | neural/models.py | ipavlopoulos/lm | b9ad7d98be47c0f1a6b446a090d1fce488bb2e3f | [
"Apache-2.0"
] | 5 | 2020-02-11T21:23:02.000Z | 2022-02-10T02:04:14.000Z | neural/models.py | ipavlopoulos/lm | b9ad7d98be47c0f1a6b446a090d1fce488bb2e3f | [
"Apache-2.0"
] | 1 | 2020-09-25T15:47:08.000Z | 2020-09-25T15:47:08.000Z | import numpy as np
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential
from tensorflow.keras.layer... | 44.603376 | 139 | 0.642796 | import numpy as np
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential
from tensorflow.keras.layer... | true | true |
1c37f7cd5825758bf9268df6fa253c9ebf526fb7 | 16,257 | py | Python | python/ray/tune/experiment.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/experiment.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | null | null | null | python/ray/tune/experiment.py | yuanchi2807/ray | cf512254bb4bcd71ff1818dff5c868ab10c5f620 | [
"Apache-2.0"
] | 1 | 2022-03-24T22:48:21.000Z | 2022-03-24T22:48:21.000Z | import copy
from functools import partial
import grpc
import inspect
import logging
import os
from pathlib import Path
from pickle import PicklingError
import traceback
from typing import Any, Dict, Optional, Sequence
from ray.tune.error import TuneError
from ray.tune.registry import register_trainable
from ray.tune.r... | 35.72967 | 87 | 0.596974 | import copy
from functools import partial
import grpc
import inspect
import logging
import os
from pathlib import Path
from pickle import PicklingError
import traceback
from typing import Any, Dict, Optional, Sequence
from ray.tune.error import TuneError
from ray.tune.registry import register_trainable
from ray.tune.r... | true | true |
1c37f7e1fb26d8ea5349fedd3a60f566d09cf598 | 10,488 | py | Python | tests/test_constraints.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 16,259 | 2018-05-02T02:31:30.000Z | 2022-03-31T21:50:23.000Z | tests/test_constraints.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 3,863 | 2018-05-02T13:42:39.000Z | 2022-03-31T19:03:32.000Z | tests/test_constraints.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 4,796 | 2018-05-02T07:55:51.000Z | 2022-03-31T14:46:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import unittest
import torch
from fairseq.token_generation_constraints import *
def tensorize(constraints: List[List[int]]) -> t... | 38.844444 | 147 | 0.407799 |
import sys
import unittest
import torch
from fairseq.token_generation_constraints import *
def tensorize(constraints: List[List[int]]) -> torch.Tensor:
return [torch.tensor(x) for x in constraints]
class TestHelperRoutines(unittest.TestCase):
def setUp(self):
self.examples = [
([[]], t... | true | true |
1c37f7e6c054d21b947432e0ed49dc8f464351aa | 7,653 | py | Python | formatting.py | basnijholt/qcodes-repr | ab761b385c3ec60f16e975667bc08a9e30f0cb2f | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 1 | 2020-03-27T14:16:32.000Z | 2020-03-27T14:16:32.000Z | formatting.py | basnijholt/qcodes-repr | ab761b385c3ec60f16e975667bc08a9e30f0cb2f | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | formatting.py | basnijholt/qcodes-repr | ab761b385c3ec60f16e975667bc08a9e30f0cb2f | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | """String formatting routines for qcodes.DataSet.__repr__.
This code heavily borrows from `xarray`, whose license can be found
in `licenses/XARRAY_LICENSE`.
"""
import contextlib
from datetime import datetime, timedelta
from itertools import zip_longest
import numpy as np
import pandas as pd
from pandas.errors impor... | 34.318386 | 87 | 0.647197 |
import contextlib
from datetime import datetime, timedelta
from itertools import zip_longest
import numpy as np
import pandas as pd
from pandas.errors import OutOfBoundsDatetime
from xarray.core.options import OPTIONS
def _get_indexer_at_least_n_items(shape, n_desired, from_end):
assert 0 < n_desired <= np.pro... | true | true |
1c37f80ab49df26482e3284512cd6e122b448ff3 | 439 | py | Python | nadine/migrations/0002_auto_20150623_1653.py | FarsetLabs/farset-nadine | f0f5e81a9fbe98a4333f6318443fefbb5517c60f | [
"Apache-2.0"
] | null | null | null | nadine/migrations/0002_auto_20150623_1653.py | FarsetLabs/farset-nadine | f0f5e81a9fbe98a4333f6318443fefbb5517c60f | [
"Apache-2.0"
] | 4 | 2021-03-19T16:10:13.000Z | 2022-03-12T00:55:50.000Z | nadine/migrations/0002_auto_20150623_1653.py | FarsetLabs/farset-nadine | f0f5e81a9fbe98a4333f6318443fefbb5517c60f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('nadine', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='m... | 20.904762 | 68 | 0.624146 | from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('nadine', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='member',
name... | true | true |
1c37f81033c088ac5b6d8e9188f6a52d509c8de9 | 776 | py | Python | Python3/0568-Maximum-Vacation-Days/soln-2.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0568-Maximum-Vacation-Days/soln-2.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0568-Maximum-Vacation-Days/soln-2.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def maxVacationDays(self, flights: List[List[int]], days: List[List[int]]) -> int:
graph = collections.defaultdict(set)
N = len(flights)
for i in range(N):
for j in range(N):
if flights[i][j]:
graph[j].add(i)
for i in ra... | 35.272727 | 86 | 0.420103 | class Solution:
def maxVacationDays(self, flights: List[List[int]], days: List[List[int]]) -> int:
graph = collections.defaultdict(set)
N = len(flights)
for i in range(N):
for j in range(N):
if flights[i][j]:
graph[j].add(i)
for i in ra... | true | true |
1c37fb13067944f3c1ba1913aed20285b9dd6423 | 669 | py | Python | src/apps/smallbank/tests/small_bank_client.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 530 | 2019-05-07T03:07:15.000Z | 2022-03-29T16:33:06.000Z | src/apps/smallbank/tests/small_bank_client.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 3,393 | 2019-05-07T08:33:32.000Z | 2022-03-31T14:57:14.000Z | src/apps/smallbank/tests/small_bank_client.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 158 | 2019-05-07T09:17:56.000Z | 2022-03-25T16:45:04.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.perfclient
import sys
import os
if __name__ == "__main__":
def add(parser):
parser.add_argument(
"-u", "--accounts", help="Number of accounts", default=10, type=int
)
... | 29.086957 | 80 | 0.684604 | import infra.perfclient
import sys
import os
if __name__ == "__main__":
def add(parser):
parser.add_argument(
"-u", "--accounts", help="Number of accounts", default=10, type=int
)
args, unknown_args = infra.perfclient.cli_args(add=add, accept_unknown=True)
unknown_args = [ter... | true | true |
1c37fb2836ff26f75ba7be240ba71968c1b15ad0 | 555 | py | Python | qtanim/util.py | plotlyst/qt-anim | 1729512448cabf33cbd5c899a1c0de5afc57115b | [
"MIT"
] | null | null | null | qtanim/util.py | plotlyst/qt-anim | 1729512448cabf33cbd5c899a1c0de5afc57115b | [
"MIT"
] | 7 | 2022-02-15T07:25:43.000Z | 2022-02-24T17:45:46.000Z | qtanim/util.py | plotlyst/qt-anim | 1729512448cabf33cbd5c899a1c0de5afc57115b | [
"MIT"
] | null | null | null | from qtpy.QtCore import QPropertyAnimation
def reverse(animation: QPropertyAnimation) -> QPropertyAnimation:
reversed_animation = QPropertyAnimation(animation.targetObject(), animation.propertyName(), animation.parent())
reversed_animation.setDuration(animation.duration())
reversed_animation.setLoopCount(... | 42.692308 | 115 | 0.814414 | from qtpy.QtCore import QPropertyAnimation
def reverse(animation: QPropertyAnimation) -> QPropertyAnimation:
reversed_animation = QPropertyAnimation(animation.targetObject(), animation.propertyName(), animation.parent())
reversed_animation.setDuration(animation.duration())
reversed_animation.setLoopCount(... | true | true |
1c37fb8c8a637edc0ca9c8e3cc568657dc45cffb | 3,423 | py | Python | examples/03-Circuit/Touchstone_Management.py | PipKat/pyaedt | 0c56c35cab30ef2ba63a0333b64c3d34f9f9820d | [
"MIT"
] | null | null | null | examples/03-Circuit/Touchstone_Management.py | PipKat/pyaedt | 0c56c35cab30ef2ba63a0333b64c3d34f9f9820d | [
"MIT"
] | null | null | null | examples/03-Circuit/Touchstone_Management.py | PipKat/pyaedt | 0c56c35cab30ef2ba63a0333b64c3d34f9f9820d | [
"MIT"
] | null | null | null | """
Manage Touchstone Objects
--------------------------
This example shows how to use Touchstone objects without opening AEDT.
To provide the advanced postprocessing features needed for this example, Matplotlib and NumPy
must be installed on the machine.
This example runs only on Windows using CPython.
"""
# sphinx_... | 34.928571 | 116 | 0.659947 |
import os
import pathlib
import sys
local_path = os.path.abspath("")
module_path = pathlib.Path(local_path)
root_path = module_path.parent
root_path2 = root_path.parent
root_path3 = root_path2.parent
path1 = os.path.join(root_path2)
path2 = os.path.join(root_path3)
sys.path.append(path1)
sys.path.append(path2)
from p... | true | true |
1c37fbe3740f799e230448731507ac360a8008e0 | 1,145 | py | Python | Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/059.py | rafaelvizu/Estudos | eef5e3e3706ff99959226c51b9907b6af4377bfe | [
"MIT"
] | null | null | null | Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/059.py | rafaelvizu/Estudos | eef5e3e3706ff99959226c51b9907b6af4377bfe | [
"MIT"
] | null | null | null | Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/059.py | rafaelvizu/Estudos | eef5e3e3706ff99959226c51b9907b6af4377bfe | [
"MIT"
] | null | null | null | print('\033[36;40mExercício Python #059 - Criando um Menu de Opções\033[m')
from time import sleep
n1 = float(input(' DIGITE UM NÚMERO: '))
n2 = float(input(' DIGITE OUTRO NÚMERO: '))
sleep(1)
print('=-=' * 20)
escolha = 0
t = 0
maior = 0
while escolha != 5:
print('=-=' * 20)
print(''' |1| somar
|2... | 25.444444 | 75 | 0.504803 | print('\033[36;40mExercício Python #059 - Criando um Menu de Opções\033[m')
from time import sleep
n1 = float(input(' DIGITE UM NÚMERO: '))
n2 = float(input(' DIGITE OUTRO NÚMERO: '))
sleep(1)
print('=-=' * 20)
escolha = 0
t = 0
maior = 0
while escolha != 5:
print('=-=' * 20)
print(''' |1| somar
|2... | true | true |
1c37fc0590e08961d14854434f713d4788951f42 | 11,430 | py | Python | lale/lib/autogen/random_forest_regressor.py | gbdrt/lale | 291f824a6b96f088e787979ca768f50d7758424e | [
"Apache-2.0"
] | null | null | null | lale/lib/autogen/random_forest_regressor.py | gbdrt/lale | 291f824a6b96f088e787979ca768f50d7758424e | [
"Apache-2.0"
] | null | null | null | lale/lib/autogen/random_forest_regressor.py | gbdrt/lale | 291f824a6b96f088e787979ca768f50d7758424e | [
"Apache-2.0"
] | null | null | null | from numpy import inf, nan
from sklearn.ensemble import RandomForestRegressor as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class RandomForestRegressorImpl:
def __init__(self, **hyperparams):
self._hyperparams = hyperparams
self._wrapped_model = Op(**se... | 40.967742 | 263 | 0.438058 | from numpy import inf, nan
from sklearn.ensemble import RandomForestRegressor as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class RandomForestRegressorImpl:
def __init__(self, **hyperparams):
self._hyperparams = hyperparams
self._wrapped_model = Op(**se... | true | true |
1c37fd2e142da8bf1ac16171e19030e040e98417 | 163 | py | Python | player/views.py | BehindLoader/bandcamp-parser | bb1d2278d8275bd29888ce9a4fd5627400543cd0 | [
"MIT"
] | null | null | null | player/views.py | BehindLoader/bandcamp-parser | bb1d2278d8275bd29888ce9a4fd5627400543cd0 | [
"MIT"
] | null | null | null | player/views.py | BehindLoader/bandcamp-parser | bb1d2278d8275bd29888ce9a4fd5627400543cd0 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render_to_response
def index(request):
return HttpResponse(render_to_response('index.html')) | 32.6 | 57 | 0.828221 | from django.http import HttpResponse
from django.shortcuts import render_to_response
def index(request):
return HttpResponse(render_to_response('index.html')) | true | true |
1c37fde31ae7cbc8d4dffa6ba9e15c4e16302abc | 28,755 | py | Python | web/handlers/user.py | billypon/qiandao | 7e0d883c294ada443b1cdaf7e7e44538b30ab8e0 | [
"MIT"
] | 2 | 2020-07-15T13:33:26.000Z | 2021-11-27T13:33:34.000Z | web/handlers/user.py | billypon/qiandao | 7e0d883c294ada443b1cdaf7e7e44538b30ab8e0 | [
"MIT"
] | 1 | 2021-04-09T17:21:07.000Z | 2021-04-09T17:21:07.000Z | web/handlers/user.py | BlueskyClouds/qiandao | 5154c09963e1d05ce077772868cfcf4614f551c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-08-09 11:39:25
import json
import time
import datetime
from tornado import gen
import re
import os
import config
from .base import *
import sqlite3
... | 45.861244 | 222 | 0.469623 |
import json
import time
import datetime
from tornado import gen
import re
import os
import config
from .base import *
import sqlite3
from backup import DBnew
import codecs
import traceback
from libs.funcs import pusher
def tostr(s):
if isinstance(s, bytes):
try:
return s.decode()
e... | true | true |
1c37fe08e652b5a8d8bac27da9b61ca7524d1ea8 | 1,239 | py | Python | environments/mujoco/rand_param_envs/gym/envs/mujoco/swimmer.py | lfeng1999/varibad | 840f4bd56ccee96a6c162265d18ec54db8b77a1e | [
"MIT"
] | 119 | 2020-02-12T07:06:17.000Z | 2022-03-24T08:37:34.000Z | environments/mujoco/rand_param_envs/gym/envs/mujoco/swimmer.py | lfeng1999/varibad | 840f4bd56ccee96a6c162265d18ec54db8b77a1e | [
"MIT"
] | 2 | 2020-05-24T22:33:42.000Z | 2020-09-28T16:42:02.000Z | environments/mujoco/rand_param_envs/gym/envs/mujoco/swimmer.py | lfeng1999/varibad | 840f4bd56ccee96a6c162265d18ec54db8b77a1e | [
"MIT"
] | 26 | 2020-04-20T13:10:11.000Z | 2022-03-22T10:21:10.000Z | import numpy as np
from environments.mujoco.rand_param_envs.gym import utils
from environments.mujoco.rand_param_envs.gym.envs.mujoco import mujoco_env
class SwimmerEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'swimmer.xml', 4)
utils.EzPickle.... | 36.441176 | 90 | 0.66021 | import numpy as np
from environments.mujoco.rand_param_envs.gym import utils
from environments.mujoco.rand_param_envs.gym.envs.mujoco import mujoco_env
class SwimmerEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'swimmer.xml', 4)
utils.EzPickle.... | true | true |
1c37fefbd00e7eae361d044574c913669ad2c0db | 5,098 | py | Python | options/base_options.py | thsshz/DeblurGAN | b0c786e15256639f145737874aa71fc77263b959 | [
"BSD-3-Clause"
] | null | null | null | options/base_options.py | thsshz/DeblurGAN | b0c786e15256639f145737874aa71fc77263b959 | [
"BSD-3-Clause"
] | null | null | null | options/base_options.py | thsshz/DeblurGAN | b0c786e15256639f145737874aa71fc77263b959 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import os
from util import util
import torch
class BaseOptions():
def __init__(self):
self.parser = argparse.ArgumentParser()
self.initialized = False
def initialize(self):
self.parser.add_argument('--dataroot', required=True, help='path to images (should have subfolders trainA, trainB, valA, ... | 63.725 | 222 | 0.711455 | import argparse
import os
from util import util
import torch
class BaseOptions():
def __init__(self):
self.parser = argparse.ArgumentParser()
self.initialized = False
def initialize(self):
self.parser.add_argument('--dataroot', required=True, help='path to images (should have subfolders trainA, trainB, valA, ... | true | true |
1c37ff2ad8567d8ae0bf7a3f195e7c78d5ce73e3 | 8,442 | py | Python | agents/HPG/HPG_Gaussian.py | best99317/Deep-RL-Package | 8a6fe4d80c3ab12d062d6aeecac5a50ac5144aad | [
"MIT"
] | 1 | 2020-11-23T13:01:50.000Z | 2020-11-23T13:01:50.000Z | agents/HPG/HPG_Gaussian.py | best99317/Deep-RL-Package | 8a6fe4d80c3ab12d062d6aeecac5a50ac5144aad | [
"MIT"
] | null | null | null | agents/HPG/HPG_Gaussian.py | best99317/Deep-RL-Package | 8a6fe4d80c3ab12d062d6aeecac5a50ac5144aad | [
"MIT"
] | null | null | null | import torch
import numpy as np
from agents.HPG.HPG import HPG
from agents.VPG.VPG_Gaussian import VPG_Gaussian
class HPG_Gaussian(HPG, VPG_Gaussian):
def __init__(self, parameters):
super(HPG_Gaussian, self).__init__(parameters)
def generate_fake_data(self):
self.subgoals = torch.... | 53.09434 | 144 | 0.581853 | import torch
import numpy as np
from agents.HPG.HPG import HPG
from agents.VPG.VPG_Gaussian import VPG_Gaussian
class HPG_Gaussian(HPG, VPG_Gaussian):
def __init__(self, parameters):
super(HPG_Gaussian, self).__init__(parameters)
def generate_fake_data(self):
self.subgoals = torch.... | true | true |
1c37ff37b67a9c10cb9e908d037585d276d1221d | 1,683 | py | Python | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/UpdateNodeGroupRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/UpdateNodeGroupRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/UpdateNodeGroupRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # 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
# "License"); you may not u... | 37.4 | 82 | 0.771242 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdklinkwan.endpoint import endpoint_data
class UpdateNodeGroupRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'LinkWAN', '2019-03-01', 'UpdateNodeGroup','linkwan')
self.set_protocol_type('https')
self.set_method('POST')
if hasattr(... | true | true |
1c380014554ec0ceb12517cd16576401efeaaf7e | 126 | py | Python | autoarray/inversion/pixelizations/__init__.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 5 | 2019-09-26T02:18:25.000Z | 2021-12-11T16:29:20.000Z | autoarray/inversion/pixelizations/__init__.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 3 | 2020-03-30T14:25:57.000Z | 2021-12-21T17:10:55.000Z | autoarray/inversion/pixelizations/__init__.py | Jammy2211/PyAutoArray | 1fb9c84ca2a3333abedfbf96d070fc355e2628e4 | [
"MIT"
] | 4 | 2020-03-03T11:35:41.000Z | 2022-01-21T17:37:35.000Z | from .rectangular import Rectangular
from .voronoi import VoronoiMagnification
from .voronoi import VoronoiBrightnessImage
| 31.5 | 44 | 0.857143 | from .rectangular import Rectangular
from .voronoi import VoronoiMagnification
from .voronoi import VoronoiBrightnessImage
| true | true |
1c38018da44b416e1337f2f34a5b081d20ba6544 | 4,940 | py | Python | Lab4/nnCostFunction.py | A2Zntu/ML_HW | 00db8a45ba38fc864b71c31b0255488c95880c4c | [
"MIT"
] | null | null | null | Lab4/nnCostFunction.py | A2Zntu/ML_HW | 00db8a45ba38fc864b71c31b0255488c95880c4c | [
"MIT"
] | null | null | null | Lab4/nnCostFunction.py | A2Zntu/ML_HW | 00db8a45ba38fc864b71c31b0255488c95880c4c | [
"MIT"
] | null | null | null | import numpy as np
from sigmoid import sigmoid
from sigmoidGradient import sigmoidGradient
def nnCostFunction(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y, lambda_value):
#NNCOSTFUNCTION Implements the neural network cost function for a two layer
#neural network which performs classification
# [J... | 42.586207 | 114 | 0.646559 | import numpy as np
from sigmoid import sigmoid
from sigmoidGradient import sigmoidGradient
def nnCostFunction(nn_params, input_layer_size, hidden_layer_size, num_labels, X, y, lambda_value):
tmp = nn_params.copy()
Theta1 = np.reshape(tmp[0:hidden_layer_size * (input_layer_size + 1)],
... | true | true |
1c38024d6c075a32b114098fa9e7a6ebcbd25700 | 805 | py | Python | rpython/rlib/test/test_rawstorage.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/rlib/test/test_rawstorage.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/rlib/test/test_rawstorage.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z |
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.rawstorage import alloc_raw_storage, free_raw_storage,\
raw_storage_setitem, raw_storage_getitem
from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin
def test_untranslated_storage():
r = alloc_raw_storage(15)
raw_storage... | 33.541667 | 73 | 0.680745 |
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.rawstorage import alloc_raw_storage, free_raw_storage,\
raw_storage_setitem, raw_storage_getitem
from rpython.rtyper.test.tool import BaseRtypingTest, LLRtypeMixin
def test_untranslated_storage():
r = alloc_raw_storage(15)
raw_storage... | true | true |
1c380329c78e1bd7aab4ee117625a7ba922d0295 | 675 | py | Python | notebook/dict_merge.py | shuaiwang88/python-snippets | daea8095ce50d08c3b15cb6747a8397abe7852f5 | [
"MIT"
] | null | null | null | notebook/dict_merge.py | shuaiwang88/python-snippets | daea8095ce50d08c3b15cb6747a8397abe7852f5 | [
"MIT"
] | null | null | null | notebook/dict_merge.py | shuaiwang88/python-snippets | daea8095ce50d08c3b15cb6747a8397abe7852f5 | [
"MIT"
] | null | null | null | d1 = {'k1': 1, 'k2': 2}
d2 = {'k1': 100, 'k3': 3, 'k4': 4}
print(d1 | d2)
# {'k1': 100, 'k2': 2, 'k3': 3, 'k4': 4}
print(d2 | d1)
# {'k1': 1, 'k3': 3, 'k4': 4, 'k2': 2}
d1 = {'k1': 1, 'k2': 2}
d2 = {'k3': 3, 'k4': 4}
d3 = {'k5': 5, 'k6': 6}
print(d1 | d2 | d3)
# {'k1': 1, 'k2': 2, 'k3': 3, 'k4': 4, 'k5': 5, 'k6': 6... | 21.09375 | 65 | 0.394074 | d1 = {'k1': 1, 'k2': 2}
d2 = {'k1': 100, 'k3': 3, 'k4': 4}
print(d1 | d2)
print(d2 | d1)
d1 = {'k1': 1, 'k2': 2}
d2 = {'k3': 3, 'k4': 4}
d3 = {'k5': 5, 'k6': 6}
print(d1 | d2 | d3)
d1 = {'k1': 1, 'k2': 2}
d2 = {'k1': 100, 'k3': 3, 'k4': 4}
d1 |= d2
print(d1)
d = {'k1': 1, 'k2': 2}
d |= [('k1', 100), ('k3', 3), ... | true | true |
1c3804b9974ce3beb0690c202a370415a182d3e5 | 2,836 | py | Python | utils/config_loader.py | kevinchoy/oct-schlemm-seg | e8b78695521dc65a7bbd1bcdb65b0a6200af25b3 | [
"BSD-4-Clause-UC"
] | 1 | 2021-11-17T01:54:53.000Z | 2021-11-17T01:54:53.000Z | utils/config_loader.py | kevinchoy/oct-schlemm-seg | e8b78695521dc65a7bbd1bcdb65b0a6200af25b3 | [
"BSD-4-Clause-UC"
] | 1 | 2022-01-24T18:20:04.000Z | 2022-01-24T18:20:04.000Z | utils/config_loader.py | kevinchoy/oct-schlemm-seg | e8b78695521dc65a7bbd1bcdb65b0a6200af25b3 | [
"BSD-4-Clause-UC"
] | null | null | null | """Code for "K. C. Choy, G. Li, W. D. Stamer, S. Farsiu, Open-source deep learning-based automatic segmentation of
mouse Schlemm’s canal in optical coherence tomography images. Experimental Eye Research, 108844 (2021)."
Link: https://www.sciencedirect.com/science/article/pii/S0014483521004103
DOI: 10.1016/j.exer.2021.1... | 35.898734 | 116 | 0.675247 |
import importlib
from typing import Any
from omegaconf import DictConfig
def load_obj(obj_path: str, default_obj_path: str = "") -> Any:
obj_path_list = obj_path.rsplit(".", 1)
obj_path = obj_path_list.pop(0) if len(obj_path_list) > 1 else default_obj_path
obj_name = obj_path_list[0]
module_obj = impo... | true | true |
1c3804f37d05d56c1f4a0f5c4b6da2ca6712099c | 3,618 | py | Python | pybbbc/constants.py | giacomodeodato/Cellular-Images-Dataset | 27d6289d231f869561e0515ecce4934a8e744f39 | [
"MIT"
] | 2 | 2021-07-21T22:49:22.000Z | 2021-08-22T18:17:32.000Z | pybbbc/constants.py | zbarry/pybbbc | 396e78034c3a50fdb585415cbdacd2f8634d6a94 | [
"MIT"
] | 1 | 2021-07-23T23:32:47.000Z | 2021-08-22T13:27:45.000Z | pybbbc/constants.py | zbarry/pybbbc | 396e78034c3a50fdb585415cbdacd2f8634d6a94 | [
"MIT"
] | 1 | 2021-07-21T22:53:08.000Z | 2021-07-21T22:53:08.000Z | """ BBBC021 dataset constants. """
IMG_SHAPE = (3, 1024, 1280)
CHANNELS = ["Actin", "Tubulin", "DAPI"]
N_SITES = 4
PLATES = [
"Week10_40111",
"Week10_40115",
"Week10_40119",
"Week1_22123",
"Week1_22141",
"Week1_22161",
"Week1_22361",
"Week1_22381",
"Week1_22401",
"Week2_24121... | 18.180905 | 39 | 0.556938 |
IMG_SHAPE = (3, 1024, 1280)
CHANNELS = ["Actin", "Tubulin", "DAPI"]
N_SITES = 4
PLATES = [
"Week10_40111",
"Week10_40115",
"Week10_40119",
"Week1_22123",
"Week1_22141",
"Week1_22161",
"Week1_22361",
"Week1_22381",
"Week1_22401",
"Week2_24121",
"Week2_24141",
"Week2_24... | true | true |
1c3805f144c5a71a1bd4b488518ca391dd627c63 | 2,210 | py | Python | runtest_single.py | ayanc/edgeml.mdp | 7f21b88bcf764e927ac8b9997ac9f3b1b2dabcc4 | [
"MIT"
] | 2 | 2020-10-26T21:02:07.000Z | 2021-12-26T19:53:15.000Z | runtest_single.py | ayanc/edgeml.mdp | 7f21b88bcf764e927ac8b9997ac9f3b1b2dabcc4 | [
"MIT"
] | null | null | null | runtest_single.py | ayanc/edgeml.mdp | 7f21b88bcf764e927ac8b9997ac9f3b1b2dabcc4 | [
"MIT"
] | 2 | 2020-10-27T04:43:36.000Z | 2020-12-11T12:47:08.000Z | #!/usr/bin/env python3
# - Ayan Chakrabarti <ayan.chakrabarti@gmail.com>
"""Run experiments to derive and simulate policies for single cameras."""
from multiprocessing import Pool
import numpy as np
from eomdp import simulate as sim
from eomdp import policy as po
FMPATH = 'save/fm_fold%d_cost%d.npz'
OPATH = 'save/1ca... | 34.53125 | 78 | 0.572398 |
from multiprocessing import Pool
import numpy as np
from eomdp import simulate as sim
from eomdp import policy as po
FMPATH = 'save/fm_fold%d_cost%d.npz'
OPATH = 'save/1cam_r%03d_bdepth%02d_cost%d.npz'
PLIST = [(r/20, b/2, c)
for b in range(2, 11)
for r in range(1, 11)
for c in range(3)]
... | true | true |
1c38069901471e89c9b3e32998ffc6795a026a6c | 6,601 | py | Python | alexa/lambda_function.py | jschmidtnj/healthtech19 | 06c0030d0adf3c50d80c88d60dd66d658d52fc94 | [
"MIT"
] | null | null | null | alexa/lambda_function.py | jschmidtnj/healthtech19 | 06c0030d0adf3c50d80c88d60dd66d658d52fc94 | [
"MIT"
] | 4 | 2021-06-08T20:40:24.000Z | 2022-03-12T00:09:32.000Z | alexa/lambda_function.py | jschmidtnj/healthtech19 | 06c0030d0adf3c50d80c88d60dd66d658d52fc94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK for Python.
# Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
# session persistence, api calls, and more.
# This sample is built using the ... | 34.742105 | 110 | 0.695955 |
import logging
import ask_sdk_core.utils as ask_utils
from ask_sdk_core.utils import get_slot_value
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.dispatch_components import AbstractRequestHandler
from ask_sdk_core.dispatch_components import AbstractExceptionHandler
from ask_sdk_core.handler_in... | true | true |
1c3807a5a7198de51812a4f37f55ff871b501615 | 16,273 | py | Python | trestle/core/repository.py | guyzyl/compliance-trestle | b6fa6f5d8bfdb52e0a82fc0accd63c11d04d9afc | [
"Apache-2.0"
] | 1 | 2022-01-07T01:11:03.000Z | 2022-01-07T01:11:03.000Z | trestle/core/repository.py | guyzyl/compliance-trestle | b6fa6f5d8bfdb52e0a82fc0accd63c11d04d9afc | [
"Apache-2.0"
] | null | null | null | trestle/core/repository.py | guyzyl/compliance-trestle | b6fa6f5d8bfdb52e0a82fc0accd63c11d04d9afc | [
"Apache-2.0"
] | null | null | null | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2021 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... | 44.461749 | 118 | 0.67824 |
import argparse
import logging
import os
import pathlib
import shutil
from typing import List, Type
import trestle.core.commands.assemble as assemblecmd
import trestle.core.commands.merge as mergecmd
import trestle.core.commands.split as splitcmd
import trestle.core.commands.validate as validatecmd
import trestle.co... | true | true |
1c38082e57210f4dad01b766fd068864b70ee4b6 | 8,068 | py | Python | gas-adsorption/isothermal-ads-gas-cartoon.py | SimonEnsemble/thesis-pommerenck-1 | c546b981b0fa7cebbe80e32d45dee5e8714ea89c | [
"MIT"
] | 1 | 2021-03-24T00:42:10.000Z | 2021-03-24T00:42:10.000Z | gas-adsorption/isothermal-ads-gas-cartoon.py | SimonEnsemble/thesis-pommerenck-1 | c546b981b0fa7cebbe80e32d45dee5e8714ea89c | [
"MIT"
] | null | null | null | gas-adsorption/isothermal-ads-gas-cartoon.py | SimonEnsemble/thesis-pommerenck-1 | c546b981b0fa7cebbe80e32d45dee5e8714ea89c | [
"MIT"
] | 1 | 2021-03-23T18:42:16.000Z | 2021-03-23T18:42:16.000Z | from __future__ import division, print_function
import sys, os, re, matplotlib
import numpy as np
import matplotlib.pyplot as plt
import numericalunits, colors
matplotlib.rcParams['text.usetex'] = True
from matplotlib.font_manager import FontProperties
small_font = FontProperties()
small_font.set_size('small')
"""
... | 33.065574 | 94 | 0.675756 | from __future__ import division, print_function
import sys, os, re, matplotlib
import numpy as np
import matplotlib.pyplot as plt
import numericalunits, colors
matplotlib.rcParams['text.usetex'] = True
from matplotlib.font_manager import FontProperties
small_font = FontProperties()
small_font.set_size('small')
Ke... | true | true |
1c3808405ceeb080bb162440ec4e5ef6f3314d17 | 355 | py | Python | atest/testdata/core/resources_and_variables/vars_from_cli.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | atest/testdata/core/resources_and_variables/vars_from_cli.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | atest/testdata/core/resources_and_variables/vars_from_cli.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | scalar_from_cli_varfile = 'Scalar from variable file from cli'
scalar_from_cli_varfile_with_escapes = '1 \\ 2\\\\ ${inv}'
list_var_from_cli_varfile = 'Scalar list from variable file from cli'.split()
LIST__list_var_from_cli_varfile = 'List from variable file from cli'.split()
clivar = 'This value is not taken into use ... | 71 | 78 | 0.788732 | scalar_from_cli_varfile = 'Scalar from variable file from cli'
scalar_from_cli_varfile_with_escapes = '1 \\ 2\\\\ ${inv}'
list_var_from_cli_varfile = 'Scalar list from variable file from cli'.split()
LIST__list_var_from_cli_varfile = 'List from variable file from cli'.split()
clivar = 'This value is not taken into use ... | true | true |
1c3808f407eca8b39d1ee43531c7f46c298bde7b | 875 | py | Python | tests/null_queries/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 3 | 2020-05-30T17:08:51.000Z | 2021-12-14T02:55:19.000Z | tests/null_queries/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 1 | 2021-03-24T12:21:05.000Z | 2021-03-24T12:31:52.000Z | tests/null_queries/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 4 | 2016-07-31T14:29:15.000Z | 2021-10-19T03:32:44.000Z | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Poll(models.Model):
question = models.CharField(max_length=200)
def __str__(self):
return "Q: %s " % self.question
@python_2_unicode... | 23.026316 | 65 | 0.730286 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Poll(models.Model):
question = models.CharField(max_length=200)
def __str__(self):
return "Q: %s " % self.question
@python_2_unicode... | true | true |
1c38098e2e0cbd4a4f5f91067a4c67b626320d11 | 121 | py | Python | gallery/admin.py | paint-your-blues/platform | f149ae4269a65dd58bed8bc2aaecc729225c7a35 | [
"MIT"
] | null | null | null | gallery/admin.py | paint-your-blues/platform | f149ae4269a65dd58bed8bc2aaecc729225c7a35 | [
"MIT"
] | 9 | 2020-05-15T07:56:36.000Z | 2022-03-12T00:29:53.000Z | gallery/admin.py | paint-your-blues/platform | f149ae4269a65dd58bed8bc2aaecc729225c7a35 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import Gallery
admin.site.register(Gallery) | 17.285714 | 32 | 0.801653 | from django.contrib import admin
from .models import Gallery
admin.site.register(Gallery) | true | true |
1c380a98335558caacf7e721683162e61b24640d | 599 | py | Python | jp.atcoder/abc162/abc162_e/28324642.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc162/abc162_e/28324642.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc162/abc162_e/28324642.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import typing
def main() -> typing.NoReturn:
n, k = map(int, input().split())
# let g := GCD(A)
# for each g, count up the number of A such that GCD(A) = g
# let this function as f(g)
# f(d) = (K // d)^N - \sum_{g=d * 2, step=d}^{K}f(g)
MOD = 10 ** 9 + 7
cnt = [0] * (k + 1)... | 21.392857 | 64 | 0.414023 | import typing
def main() -> typing.NoReturn:
n, k = map(int, input().split())
MOD = 10 ** 9 + 7
cnt = [0] * (k + 1)
for d in range(k, 0, -1):
cnt[d] = pow(k // d, n, MOD)
for g in range(d * 2, k + 1, d):
cnt[d] -= cnt[g]
cnt[d] %= MO... | true | true |
1c380ada6fce66f66954e8d644e235f8bb7554c5 | 13,937 | py | Python | TUI/TCC/NudgerWindow.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/TCC/NudgerWindow.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/TCC/NudgerWindow.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Graphical offsetter.
History:
2005-05-24 ROwen
2005-05-26 ROwen Bug fix: _iimScaleCallback was totally broken, so the nudger box
labels were always to the right and above.
2005-06-03 ROwen Improved uniformity of indentation.
2005-04-20 ROwen All offsets are now com... | 33.909976 | 108 | 0.573581 | import Tkinter
import RO.CnvUtil
import RO.Constants
import RO.Wdg
import opscore.actor.keyvar
import TUI.Base.Wdg
import TUI.Models
WindowName = "TCC.Nudger"
def addWindow(tlSet):
tlSet.createToplevel(
name = WindowName,
defGeom = "+50+507",
resizable = False,
visible = False,
... | true | true |
1c380b51f22c8559dfcda9b4e058681d75902e3c | 38,189 | py | Python | pytype/tests/test_import.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_import.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_import.py | CyberFlameGO/pytype | c8cbeea997634455b5abcb27c76c58aa0dfc25ae | [
"Apache-2.0"
] | null | null | null | """Tests for import."""
from pytype import file_utils
from pytype import imports_map_loader
from pytype.pytd import pytd_utils
from pytype.tests import test_base
DEFAULT_PYI = """
from typing import Any
def __getattr__(name) -> Any: ...
"""
class ImportTest(test_base.TargetIndependentTest):
"""Tests for import."... | 29.952157 | 80 | 0.535547 |
from pytype import file_utils
from pytype import imports_map_loader
from pytype.pytd import pytd_utils
from pytype.tests import test_base
DEFAULT_PYI = """
from typing import Any
def __getattr__(name) -> Any: ...
"""
class ImportTest(test_base.TargetIndependentTest):
def test_basic_import(self):
ty = self.I... | true | true |
1c380b68fd247efcc782fc4a623038204c503d2f | 2,305 | py | Python | web_api/vdatum_web_api.py | TashiGeleg/vyperdatum | cb7ccd3804c6acf88c9c884c6f4da874c6312498 | [
"CC0-1.0"
] | 2 | 2021-12-01T15:57:34.000Z | 2021-12-03T14:37:48.000Z | web_api/vdatum_web_api.py | TashiGeleg/vyperdatum | cb7ccd3804c6acf88c9c884c6f4da874c6312498 | [
"CC0-1.0"
] | 6 | 2020-12-04T18:07:12.000Z | 2020-12-22T16:59:07.000Z | web_api/vdatum_web_api.py | TashiGeleg/vyperdatum | cb7ccd3804c6acf88c9c884c6f4da874c6312498 | [
"CC0-1.0"
] | 3 | 2020-12-04T18:04:25.000Z | 2021-06-24T15:29:11.000Z | try: # python27
import urllib2
except ImportError: # python38
from urllib.request import Request, urlopen
import json
import time
def vdatum_web_api(src_lat, src_lon, src_height, region='CONTIGUOUS', s_h_frame='NAD83_2011', s_v_frame='MLLW',
t_h_frame='NAD83_2011', t_v_frame='NAVD88'):
... | 29.935065 | 143 | 0.63731 | try: import urllib2
except ImportError: from urllib.request import Request, urlopen
import json
import time
def vdatum_web_api(src_lat, src_lon, src_height, region='CONTIGUOUS', s_h_frame='NAD83_2011', s_v_frame='MLLW',
t_h_frame='NAD83_2011', t_v_frame='NAVD88'):
url = 'https://vdat... | true | true |
1c380bbbbb91b34e5c8a22816a2b46a968c4393b | 7,867 | py | Python | malaya_speech/train/prepare_data.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/prepare_data.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/prepare_data.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | 1 | 2021-08-19T02:34:41.000Z | 2021-08-19T02:34:41.000Z | # coding=utf-8
# Copyright 2020 The Tensor2Tensor 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 by applicable... | 33.909483 | 82 | 0.652727 |
import tensorflow as tf
import numpy as np
import six
import os
import random
UNSHUFFLED_SUFFIX = '-unshuffled'
def read_records(filename):
reader = tf.python_io.tf_record_iterator(filename)
records = []
for record in reader:
records.append(record)
if len(records) % 100000 == 0:
... | true | true |
1c380c77e71d65b628ba4fa9d365cec89f06364c | 1,234 | py | Python | projects/models/experiment.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/models/experiment.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/models/experiment.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Experiment model."""
from datetime import datetime
from sqlalchemy import Boolean, Column, DateTime, Integer, String, Text, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.sql import expression
from .operators import Operator
from ..database import Base
from ..utils impor... | 37.393939 | 90 | 0.709887 | from datetime import datetime
from sqlalchemy import Boolean, Column, DateTime, Integer, String, Text, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.sql import expression
from .operators import Operator
from ..database import Base
from ..utils import to_camel_case
class Experiment(Base):
__... | true | true |
1c380c9786adad8e2aaef3294fc457c7c0aad6a0 | 9,930 | py | Python | test/diff/diff_files/generate_tests.py | coidx/SPIRV-Tools | d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac | [
"Apache-2.0"
] | null | null | null | test/diff/diff_files/generate_tests.py | coidx/SPIRV-Tools | d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac | [
"Apache-2.0"
] | null | null | null | test/diff/diff_files/generate_tests.py | coidx/SPIRV-Tools | d18d0d92e55f44da6af0dc87fb0e3c8034e9a3ac | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python3
#
# Copyright (c) 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.557377 | 114 | 0.697583 |
import glob
import os
import subprocess
import sys
IGNORE_SET_BINDING_TESTS = ['different_decorations_vertex']
IGNORE_LOCATION_TESTS = ['different_decorations_fragment']
IGNORE_DECORATIONS_TESTS = ['different_decorations_vertex', 'different_decorations_fragment']
DUMP_IDS_TESTS = ['basic', 'int_vs_uint_constants', 'm... | true | true |
1c380d42d9a0f0b5434bcdaa29d49788e4646cb0 | 2,613 | py | Python | tests/test_issues.py | scikit-hep/uproot-methods | ba9a97b3dc71c7030a9ec15a9d97397b5ff8aa0d | [
"BSD-3-Clause"
] | 15 | 2018-09-25T13:14:05.000Z | 2020-09-04T08:37:45.000Z | tests/test_issues.py | scikit-hep/uproot-methods | ba9a97b3dc71c7030a9ec15a9d97397b5ff8aa0d | [
"BSD-3-Clause"
] | 72 | 2018-09-20T12:57:47.000Z | 2020-11-04T14:16:57.000Z | tests/test_issues.py | scikit-hep/uproot-methods | ba9a97b3dc71c7030a9ec15a9d97397b5ff8aa0d | [
"BSD-3-Clause"
] | 33 | 2018-09-19T22:04:44.000Z | 2020-11-29T09:37:09.000Z | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot3-methods/blob/master/LICENSE
import unittest
import numpy
import awkward0
import uproot3_methods
from uproot3_methods import *
import inspect
class Test(unittest.TestCase):
def runTest(self):
pass
def test_issu... | 39.590909 | 207 | 0.628779 |
import unittest
import numpy
import awkward0
import uproot3_methods
from uproot3_methods import *
import inspect
class Test(unittest.TestCase):
def runTest(self):
pass
def test_issue10(self):
p4 = TLorentzVectorArray.from_ptetaphim(awkward0.JaggedArray.fromiter([[1.0]]), awkward0.JaggedAr... | true | true |
1c380d77b5630ae7d22e8dd820f194f44e4e2a68 | 39,222 | py | Python | PlaidCTF/2021/a-fallen-lap-ray/parallel-disassembler.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | 1 | 2021-08-24T22:16:41.000Z | 2021-08-24T22:16:41.000Z | PlaidCTF/2021/a-fallen-lap-ray/parallel-disassembler.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | PlaidCTF/2021/a-fallen-lap-ray/parallel-disassembler.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import argparse
import collections
import dataclasses
import enum
import logging
import struct
import sys
import typing
import graphviz
l = logging.getLogger("assembler")
Opcode = collections.namedtuple('Opcode', ['opcode', 'num_inputs', 'repr'])
Instruction = collections.namedtuple('Instructio... | 37.749759 | 135 | 0.555454 | import argparse
import collections
import dataclasses
import enum
import logging
import struct
import sys
import typing
import graphviz
l = logging.getLogger("assembler")
Opcode = collections.namedtuple('Opcode', ['opcode', 'num_inputs', 'repr'])
Instruction = collections.namedtuple('Instruction', [
... | true | true |
1c380d94c166b32946452e8f3abbd7bcc39bcb42 | 4,500 | py | Python | drf_haystack/mixins.py | fluxility/drf-haystack | 6ff951b9d3fcba0704f891c964bf09374438d530 | [
"MIT"
] | 201 | 2015-02-14T08:17:35.000Z | 2019-07-10T04:19:04.000Z | drf_haystack/mixins.py | fluxility/drf-haystack | 6ff951b9d3fcba0704f891c964bf09374438d530 | [
"MIT"
] | 138 | 2015-02-17T09:28:33.000Z | 2019-07-30T10:29:52.000Z | drf_haystack/mixins.py | fluxility/drf-haystack | 6ff951b9d3fcba0704f891c964bf09374438d530 | [
"MIT"
] | 60 | 2015-04-01T14:51:18.000Z | 2019-05-12T15:31:52.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework.decorators import action
from rest_framework.response import Response
from drf_haystack.filters import HaystackFacetFilter
class MoreLikeThisMixin(object):
"""
Mixin class for supporting "more like this" on... | 36.585366 | 101 | 0.656444 |
from __future__ import absolute_import, unicode_literals
from rest_framework.decorators import action
from rest_framework.response import Response
from drf_haystack.filters import HaystackFacetFilter
class MoreLikeThisMixin(object):
@action(detail=True, methods=["get"], url_path="more-like-this")
def more... | true | true |
1c380f98ec8ef87ddc3121c906bebafe56b400c8 | 688 | py | Python | cia-dist-cloudformation/src/main/config/aws-org-account/stackset/security/guardduty_response.py | renovate-tests/cia | 4b340ef8afa17cffb5ffe6a5607428a5ce8c70d1 | [
"Apache-2.0"
] | 1 | 2020-06-21T13:50:03.000Z | 2020-06-21T13:50:03.000Z | cia-dist-cloudformation/src/main/config/aws-org-account/stackset/security/guardduty_response.py | renovate-tests/cia | 4b340ef8afa17cffb5ffe6a5607428a5ce8c70d1 | [
"Apache-2.0"
] | null | null | null | cia-dist-cloudformation/src/main/config/aws-org-account/stackset/security/guardduty_response.py | renovate-tests/cia | 4b340ef8afa17cffb5ffe6a5607428a5ce8c70d1 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from botocore.exceptions import ClientError
import json
import datetime
import boto3
import os
def handler(event, context):
print("log -- Event: %s " % json.dumps(event))
response = "Error auto-remediating the finding."
try:
# Set Clients
ec2 = boto3.clien... | 21.5 | 50 | 0.665698 | from __future__ import print_function
from botocore.exceptions import ClientError
import json
import datetime
import boto3
import os
def handler(event, context):
print("log -- Event: %s " % json.dumps(event))
response = "Error auto-remediating the finding."
try:
ec2 = boto3.client('ec2')
... | true | true |
1c381017729f0fcd312c110d56bf11f6a7429f9b | 448 | py | Python | app_backend/migrations/0012_enterpise_tsic_no.py | konjing/django_sme_award | 840ed3685299c77be8516acf1e8a0123930dd63d | [
"MIT"
] | null | null | null | app_backend/migrations/0012_enterpise_tsic_no.py | konjing/django_sme_award | 840ed3685299c77be8516acf1e8a0123930dd63d | [
"MIT"
] | 5 | 2021-03-19T02:32:48.000Z | 2021-06-10T19:01:30.000Z | app_backend/migrations/0012_enterpise_tsic_no.py | konjing/django_sme_award | 840ed3685299c77be8516acf1e8a0123930dd63d | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-28 01:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_backend', '0011_remove_enterpise_regis_cap'),
]
operations = [
migrations.AddField(
model_name='enterpise',
name... | 23.578947 | 98 | 0.627232 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_backend', '0011_remove_enterpise_regis_cap'),
]
operations = [
migrations.AddField(
model_name='enterpise',
name='tsic_no',
field=models.CharField(b... | true | true |
1c3810636948f78f89ffd64dd6a5e2b02a26c543 | 1,003 | py | Python | app/resources/v1/ti/indicadores_mun.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2019-07-25T21:15:05.000Z | 2019-07-25T21:15:05.000Z | app/resources/v1/ti/indicadores_mun.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 44 | 2019-08-05T15:24:00.000Z | 2022-01-31T23:11:31.000Z | app/resources/v1/ti/indicadores_mun.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2021-05-11T07:49:51.000Z | 2021-05-11T07:49:51.000Z | ''' Controller para fornecer dados da CEE '''
from flask import request
from flask_restful_swagger_2 import swagger
from resources.base import BaseResource
class IndicadoresTIMunicipiosResource(BaseResource):
''' Classe de múltiplas incidências '''
CUSTOM_SWAGGER_PARAMS = [
{"name": "categorias", "requ... | 38.576923 | 99 | 0.668993 | from flask import request
from flask_restful_swagger_2 import swagger
from resources.base import BaseResource
class IndicadoresTIMunicipiosResource(BaseResource):
CUSTOM_SWAGGER_PARAMS = [
{"name": "categorias", "required": True, "type": 'string', "in": "query",
"description": BaseResource.CAT_IND... | true | true |
1c3811440d74220dd7bffff3f385c4c72624d706 | 1,410 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GetSolutionProjectRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | 1 | 2020-12-05T03:03:46.000Z | 2020-12-05T03:03:46.000Z | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GetSolutionProjectRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GetSolutionProjectRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | null | null | null | # 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
# "License"); you may not u... | 37.105263 | 77 | 0.762411 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkiot.endpoint import endpoint_data
class GetSolutionProjectRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'GetSolutionProject','iot')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "... | true | true |
1c381191fd02c120142d8e495da7630cc597a6f6 | 5,020 | py | Python | ImageCollection/creating_monthly_imagery.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | 1 | 2020-05-31T14:19:59.000Z | 2020-05-31T14:19:59.000Z | ImageCollection/creating_monthly_imagery.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | ImageCollection/creating_monthly_imagery.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | # %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/ImageCollection/creating_monthly_imagery.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<t... | 44.035088 | 1,021 | 0.72988 |
import subprocess
try:
import geemap
except ImportError:
print('geemap package not installed. Installing ...')
subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap'])
try:
import google.colab
import geemap.eefolium as emap
except:
import geemap as emap
import ee
try:
ee.Ini... | true | true |
1c3811eb1bcfd3a389599e1e45c66e928a92ecbd | 1,552 | py | Python | ocean_lib/web3_internal/web3_provider.py | surajsjain/ocean.py | 2e853db94d9aee2a0cf6b3d58f714215b83d917b | [
"Apache-2.0"
] | 4 | 2021-07-05T20:21:41.000Z | 2021-09-02T14:13:26.000Z | ocean_lib/web3_internal/web3_provider.py | surajsjain/ocean.py | 2e853db94d9aee2a0cf6b3d58f714215b83d917b | [
"Apache-2.0"
] | null | null | null | ocean_lib/web3_internal/web3_provider.py | surajsjain/ocean.py | 2e853db94d9aee2a0cf6b3d58f714215b83d917b | [
"Apache-2.0"
] | 1 | 2021-03-25T15:04:12.000Z | 2021-03-25T15:04:12.000Z | # Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
from web3 import Web3
from ocean_lib.web3_internal.web3_overrides.http_provider import CustomHTTPProvider
class Web3Provider(object):
"""Provides the Web3 instance."""
_web3 = None
@staticmethod
def init_web3(network... | 33.73913 | 83 | 0.680412 |
from web3 import Web3
from ocean_lib.web3_internal.web3_overrides.http_provider import CustomHTTPProvider
class Web3Provider(object):
_web3 = None
@staticmethod
def init_web3(network_url=None, provider=None):
if not provider:
assert network_url, 'network_url or a provider instance i... | true | true |
1c381276560525e28dd4d871bc30a8106e9e988a | 11,793 | py | Python | train_custom.py | NISH1001/NeuralNLP-NeuralClassifier | e86f750e68879d7390f0037747336110085d2f44 | [
"Apache-2.0"
] | null | null | null | train_custom.py | NISH1001/NeuralNLP-NeuralClassifier | e86f750e68879d7390f0037747336110085d2f44 | [
"Apache-2.0"
] | null | null | null | train_custom.py | NISH1001/NeuralNLP-NeuralClassifier | e86f750e68879d7390f0037747336110085d2f44 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
"""
Tencent is pleased to support the open source community by making NeuralClassifier available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance
with the Licen... | 38.413681 | 108 | 0.639447 |
import os
import shutil
import sys
import time
import torch
from torch.utils.data import DataLoader
import util
from config import Config
from dataset.classification_dataset import ClassificationDataset
from dataset.collator import (
ClassificationCollator,
ClassificationType,
FastTextCollator,
)
from ev... | true | true |
1c38147a6ea3da84d1f04a3af0ccac44a07efe58 | 1,505 | py | Python | scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | 21 | 2021-03-09T06:35:59.000Z | 2022-02-21T22:56:15.000Z | scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | """
Perform pca on samples specific to a population
from the HGDP,1KG, and tob-wgs dataset after densifying.
Depends on hgdp1kg_tobwgs_densified_pca/hgdp_1kg_tob_wgs_densified_pca.py
"""
import click
import pandas as pd
import hail as hl
HGDP1KG_TOBWGS = (
'gs://cpg-tob-wgs-main/1kg_hgdp_densified_pca/v2/'
'... | 30.1 | 80 | 0.694352 |
import click
import pandas as pd
import hail as hl
HGDP1KG_TOBWGS = (
'gs://cpg-tob-wgs-main/1kg_hgdp_densified_pca/v2/'
'hgdp1kg_tobwgs_joined_all_samples.mt'
)
@click.command()
@click.option('--output', help='GCS output path', required=True)
@click.option('--pop', help='Population to subset from the 1KG (... | true | true |
1c3815183ab119a099f4a64a2c1d15811a0d3803 | 41,453 | py | Python | bin/grade_item.py | hifiadi/Submitty | 62a8239313cff7e3f841ff66aeda6b0557e9c15b | [
"BSD-3-Clause"
] | null | null | null | bin/grade_item.py | hifiadi/Submitty | 62a8239313cff7e3f841ff66aeda6b0557e9c15b | [
"BSD-3-Clause"
] | null | null | null | bin/grade_item.py | hifiadi/Submitty | 62a8239313cff7e3f841ff66aeda6b0557e9c15b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import argparse
import configparser
import json
import os
import tempfile
import shutil
import subprocess
import stat
import time
import dateutil
import dateutil.parser
import urllib.parse
import contextlib
from submitty_utils import dateutils, glob
import grade_items_logging
import write_grade... | 47.811995 | 164 | 0.628784 |
import argparse
import configparser
import json
import os
import tempfile
import shutil
import subprocess
import stat
import time
import dateutil
import dateutil.parser
import urllib.parse
import contextlib
from submitty_utils import dateutils, glob
import grade_items_logging
import write_grade_history
import insert_... | true | true |
1c381534cc1a0c3b535cbeb1dd6c0032c08a3f00 | 24,752 | py | Python | geo/Geoserver.py | hixi/geoserver-rest | 5fb642a811aac129b2fedc52db452664e19948ad | [
"MIT"
] | null | null | null | geo/Geoserver.py | hixi/geoserver-rest | 5fb642a811aac129b2fedc52db452664e19948ad | [
"MIT"
] | null | null | null | geo/Geoserver.py | hixi/geoserver-rest | 5fb642a811aac129b2fedc52db452664e19948ad | [
"MIT"
] | null | null | null | import pycurl
import os
import io
import requests
from .Style import coverage_style_xml, outline_only_xml, catagorize_xml, classified_xml
from .Calculation_gdal import raster_value
from .Postgres import Db
# call back class for read the data
class DataProvider(object):
def __init__(self, data):
self.data... | 41.391304 | 194 | 0.567227 | import pycurl
import os
import io
import requests
from .Style import coverage_style_xml, outline_only_xml, catagorize_xml, classified_xml
from .Calculation_gdal import raster_value
from .Postgres import Db
class DataProvider(object):
def __init__(self, data):
self.data = data
self.finished = Fals... | true | true |
1c38153ff6a00e8391f1f37e5535a6931f4300d1 | 1,420 | py | Python | libcst/codemod/commands/remove_unused_imports.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | 1 | 2021-01-18T09:50:29.000Z | 2021-01-18T09:50:29.000Z | libcst/codemod/commands/remove_unused_imports.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | libcst/codemod/commands/remove_unused_imports.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from libcst import Import, ImportFrom
from libcst.codemod import VisitorBasedCodemodCommand
from libcst.codemod.visitors import RemoveImport... | 37.368421 | 79 | 0.73169 |
from libcst import Import, ImportFrom
from libcst.codemod import VisitorBasedCodemodCommand
from libcst.codemod.visitors import RemoveImportsVisitor
class RemoveUnusedImportsCommand(VisitorBasedCodemodCommand):
DESCRIPTION: str = (
"Remove all imports that are not used in a file. "
"Note: only c... | true | true |
1c38165279bfe6c52173422aaa75695043294582 | 1,755 | py | Python | encoder.py | MR3z4/FileEncoder | 62cb257a970ea35351381bdaaaca6c5c1e2650da | [
"MIT"
] | null | null | null | encoder.py | MR3z4/FileEncoder | 62cb257a970ea35351381bdaaaca6c5c1e2650da | [
"MIT"
] | null | null | null | encoder.py | MR3z4/FileEncoder | 62cb257a970ea35351381bdaaaca6c5c1e2650da | [
"MIT"
] | null | null | null | import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
import io
import os
class AESCipher(object):
def __init__(self, key):
self.bs = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()
def encrypt(self, raw):
raw = self._pad(raw)
iv ... | 35.1 | 88 | 0.602849 | import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
import io
import os
class AESCipher(object):
def __init__(self, key):
self.bs = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()
def encrypt(self, raw):
raw = self._pad(raw)
iv ... | true | true |
1c38168d7fcd7013b9f49f6a899e4486f4958e63 | 830 | py | Python | maza/modules/creds/cameras/canon/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | 2 | 2020-02-06T20:24:31.000Z | 2022-03-08T19:07:16.000Z | maza/modules/creds/cameras/canon/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | null | null | null | maza/modules/creds/cameras/canon/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | null | null | null | from maza.core.exploit import *
from maza.modules.creds.generic.ssh_default import Exploit as SSHDefault
class Exploit(SSHDefault):
__info__ = {
"name": "Canon Camera Default SSH Creds",
"description": "Module performs dictionary attack against Canon Camera SSH service. "
"I... | 36.086957 | 97 | 0.625301 | from maza.core.exploit import *
from maza.modules.creds.generic.ssh_default import Exploit as SSHDefault
class Exploit(SSHDefault):
__info__ = {
"name": "Canon Camera Default SSH Creds",
"description": "Module performs dictionary attack against Canon Camera SSH service. "
"I... | true | true |
1c3816d4bd01e2dbb6eb65167b4a5c06a59dfd2c | 2,066 | py | Python | profiles_api/models.py | venky-web/profiles-rest-api | ad57d0591dd130eb5395f1b24a80e1e6cce05c66 | [
"MIT"
] | null | null | null | profiles_api/models.py | venky-web/profiles-rest-api | ad57d0591dd130eb5395f1b24a80e1e6cce05c66 | [
"MIT"
] | null | null | null | profiles_api/models.py | venky-web/profiles-rest-api | ad57d0591dd130eb5395f1b24a80e1e6cce05c66 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def c... | 28.694444 | 64 | 0.679574 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
def create_user(self, email, name, passwo... | true | true |
1c3817446f0e68a59131ed664303965871399618 | 1,360 | py | Python | nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import UnaryMaths
def test_UnaryMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=Tr... | 24.727273 | 78 | 0.639706 | from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import UnaryMaths
def test_UnaryMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argst... | true | true |
1c3819ecfdc0c1ae228c062d65e2afd7c8027e58 | 4,371 | py | Python | gallery/settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | null | null | null | gallery/settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | 3 | 2020-06-05T21:34:27.000Z | 2021-09-08T01:04:15.000Z | gallery/settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | null | null | null | """
Django settings for pic_galore project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
i... | 27.31875 | 91 | 0.693892 |
import os
import django_heroku
import dj_database_url
from decouple import config,Csv
MODE=config("MODE", default="dev")
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', default=False, cast=bool)
if config('MODE')=="dev":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresq... | true | true |
1c381b77ecc033b4fd6d7878f73d92f197379b61 | 12,693 | py | Python | userbot/utils/tools.py | dennisdwntr/Zelda-Ubot | 59db6ae1c62b43e604bbe848bbbe153b75ba306f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-12-27T02:23:24.000Z | 2021-12-28T06:25:39.000Z | userbot/utils/tools.py | dennisdwntr/Zelda-Ubot | 59db6ae1c62b43e604bbe848bbbe153b75ba306f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/utils/tools.py | dennisdwntr/Zelda-Ubot | 59db6ae1c62b43e604bbe848bbbe153b75ba306f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2021-12-27T02:23:06.000Z | 2022-02-05T08:33:06.000Z | # Copyright (C) 2020 Adek Maulana
#
# SPDX-License-Identifier: GPL-3.0-or-later
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | 31.7325 | 146 | 0.628929 |
import asyncio
import hashlib
import os
import os.path
import re
import shlex
import time
from os.path import basename
from typing import Optional, Union
from emoji import get_emoji_regexp
from hachoir.metadata import extractMetadata
from hachoir.parser import createParser
from html_telegraph_poster import Telegraph... | true | true |
1c381bd488d74c3243afb1591b0d03d34cf4facd | 6,691 | py | Python | RumourEval2019Models/Bert-MFajcik/utils/utils.py | isspek/veracity-detection | 9368309722bead209e49e52c206758e3d173092a | [
"MIT"
] | null | null | null | RumourEval2019Models/Bert-MFajcik/utils/utils.py | isspek/veracity-detection | 9368309722bead209e49e52c206758e3d173092a | [
"MIT"
] | null | null | null | RumourEval2019Models/Bert-MFajcik/utils/utils.py | isspek/veracity-detection | 9368309722bead209e49e52c206758e3d173092a | [
"MIT"
] | null | null | null | __author__ = "Martin Fajčík"
import math
import socket
import torch
import datetime
import logging
import logging.config
import os
import yaml
from collections import Iterable
class LevelOnly(object):
levels = {
"CRITICAL": 50,
"ERROR": 40,
"WARNING": 30,
"INFO": 20,
"DEB... | 30.834101 | 112 | 0.582125 | __author__ = "Martin Fajčík"
import math
import socket
import torch
import datetime
import logging
import logging.config
import os
import yaml
from collections import Iterable
class LevelOnly(object):
levels = {
"CRITICAL": 50,
"ERROR": 40,
"WARNING": 30,
"INFO": 20,
"DEB... | true | true |
1c381bff5a8cdd500a30b54d5bda3ef6e6606c31 | 611 | py | Python | pal/model/generic/register.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 26 | 2020-01-06T23:53:17.000Z | 2022-02-01T08:58:21.000Z | pal/model/generic/register.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 30 | 2019-11-13T00:55:22.000Z | 2022-01-06T08:09:35.000Z | pal/model/generic/register.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 14 | 2019-11-15T16:56:22.000Z | 2021-12-22T10:14:17.000Z | from dataclasses import dataclass, field as datafield
from typing import List, Dict
from pal.model.register import Register
from pal.model.access_mechanism import AbstractAccessMechanism
@dataclass
class GenericRegister(Register):
""" Models a generic register that does not belong to a particular """
""" mic... | 27.772727 | 74 | 0.657938 | from dataclasses import dataclass, field as datafield
from typing import List, Dict
from pal.model.register import Register
from pal.model.access_mechanism import AbstractAccessMechanism
@dataclass
class GenericRegister(Register):
arch: str = "generic"
access_mechanisms: Dict[str, List[AbstractAccessMechan... | true | true |
1c381ca1d0bfb2bfa74bdb6df5fe4912de8c4e23 | 2,959 | py | Python | place_points_on_surface.py | shahpnmlab/cryoem-python | d0b27dc909c5538c3117c47f94504567db6d1ea5 | [
"MIT"
] | 1 | 2020-12-19T18:46:26.000Z | 2020-12-19T18:46:26.000Z | place_points_on_surface.py | shahpnmlab/cryoEM-Python | c4e317ba9563172c70ab4571ece0a2d322a301ff | [
"MIT"
] | null | null | null | place_points_on_surface.py | shahpnmlab/cryoEM-Python | c4e317ba9563172c70ab4571ece0a2d322a301ff | [
"MIT"
] | null | null | null | '''
This script will enable you to place points on the surface of an arbitary sphere
whose center is defined by marking the center of the sphere in IMOD and saving it as
mod file. In writing this script I used CR Drost's response to the question
of how do you evenly place points on the surface of sphere?
(https://stac... | 42.884058 | 113 | 0.709023 | import numpy as np
from numpy import pi, cos, sin, arccos, arange
import subprocess
import argparse
parser=argparse.ArgumentParser()
parser.add_argument("--i", help="IMOD mod file with centers of objects selected")
parser.add_argument("--r", help="The desired radius (px).",type=float)
parser.add_argument("--npts", hel... | true | true |
1c381d53f3c3c4bcb97eda2c8cb51a65ba0f2a16 | 4,908 | py | Python | plgx-esp/polylogyx/plugins/logs/rsyslog.py | preetpoly/plgx-esp | ef03fbec2f875cc7a84db5eb2e0972c614747a9d | [
"MIT"
] | null | null | null | plgx-esp/polylogyx/plugins/logs/rsyslog.py | preetpoly/plgx-esp | ef03fbec2f875cc7a84db5eb2e0972c614747a9d | [
"MIT"
] | null | null | null | plgx-esp/polylogyx/plugins/logs/rsyslog.py | preetpoly/plgx-esp | ef03fbec2f875cc7a84db5eb2e0972c614747a9d | [
"MIT"
] | 1 | 2020-08-11T19:12:12.000Z | 2020-08-11T19:12:12.000Z | # -*- coding: utf-8 -*-
import datetime as dt
import socket
import json
from flask import current_app
from polylogyx.plugins import AbstractLogsPlugin
from polylogyx.utils import extract_results, quote, flatten_json, append_node_information_to_result_log, DateTimeEncoder
class RsyslogPlugin(AbstractLogsPlugin):
de... | 38.046512 | 161 | 0.515077 | import datetime as dt
import socket
import json
from flask import current_app
from polylogyx.plugins import AbstractLogsPlugin
from polylogyx.utils import extract_results, quote, flatten_json, append_node_information_to_result_log, DateTimeEncoder
class RsyslogPlugin(AbstractLogsPlugin):
def __init__(self, config)... | true | true |
1c381d558260e87b5f97b4cbaac3e1d11de2007c | 383 | py | Python | eslog/utils.py | wmariuss/eslog | c69173d9f1bb55aaf77e76188a0bf060f49f2d40 | [
"BSD-3-Clause"
] | 1 | 2020-09-30T15:21:02.000Z | 2020-09-30T15:21:02.000Z | eslog/utils.py | wmariuss/eslog | c69173d9f1bb55aaf77e76188a0bf060f49f2d40 | [
"BSD-3-Clause"
] | null | null | null | eslog/utils.py | wmariuss/eslog | c69173d9f1bb55aaf77e76188a0bf060f49f2d40 | [
"BSD-3-Clause"
] | null | null | null | import json
import pprint
from zipfile import ZipFile
def json_format(content):
"""Return text in JSON format"""
return json.loads(content)
def pretty(data):
"""Nice print"""
pp = pprint.PrettyPrinter(indent=2)
return pp.pprint(data)
def archive(file):
"""Archive file"""
with ZipFile("... | 18.238095 | 54 | 0.652742 | import json
import pprint
from zipfile import ZipFile
def json_format(content):
return json.loads(content)
def pretty(data):
pp = pprint.PrettyPrinter(indent=2)
return pp.pprint(data)
def archive(file):
with ZipFile("{}.zip".format(file), "w") as zipit:
zipit.write(file)
| true | true |
1c381d95a1622ec0b3b7cdee452d406f262bd735 | 7,316 | py | Python | produce_comparison_for_test.py | likedan/cp-vton | dde95aa0b3ede1e1c0e0b0a91ba94cf91ed1f79e | [
"MIT"
] | null | null | null | produce_comparison_for_test.py | likedan/cp-vton | dde95aa0b3ede1e1c0e0b0a91ba94cf91ed1f79e | [
"MIT"
] | null | null | null | produce_comparison_for_test.py | likedan/cp-vton | dde95aa0b3ede1e1c0e0b0a91ba94cf91ed1f79e | [
"MIT"
] | 1 | 2020-07-01T03:57:38.000Z | 2020-07-01T03:57:38.000Z | # coding=utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils
import argparse
import os
from torchvision.utils import save_image
from cp_dataset import CPDataset, CPDataLoader
from networks import GMM, UnetGenerator, VGGLoss, load_checkpoint, save_checkpoint
from resnet import Embedder... | 40.41989 | 126 | 0.666348 | import torch
import torch.nn as nn
import torch.nn.functional as F
import utils
import argparse
import os
from torchvision.utils import save_image
from cp_dataset import CPDataset, CPDataLoader
from networks import GMM, UnetGenerator, VGGLoss, load_checkpoint, save_checkpoint
from resnet import Embedder
from unet impo... | true | true |
1c381e03f0d781f75be5c7bbf816de0dc09d54b8 | 143 | py | Python | Sets/set.difference()_operation.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | Sets/set.difference()_operation.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | Sets/set.difference()_operation.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | n = int(input())
en = set(map(int, input().split()))
b = int(input())
fr = set(map(int, input().split()))
print(len(en.difference(fr)))
| 23.833333 | 37 | 0.573427 | n = int(input())
en = set(map(int, input().split()))
b = int(input())
fr = set(map(int, input().split()))
print(len(en.difference(fr)))
| true | true |
1c381e0e58d510c4c39c8cd8b4fb7ce56b415dee | 5,395 | py | Python | unet3d/generator_multiprocess.py | Pr0d19y/3DUnet-livers | 8b306b276228275c2f9df01c7b1468816dc1f332 | [
"MIT"
] | 6 | 2019-01-08T02:44:03.000Z | 2021-04-13T07:27:34.000Z | unet3d/generator_multiprocess.py | Pr0d19y/3DUnet-livers | 8b306b276228275c2f9df01c7b1468816dc1f332 | [
"MIT"
] | null | null | null | unet3d/generator_multiprocess.py | Pr0d19y/3DUnet-livers | 8b306b276228275c2f9df01c7b1468816dc1f332 | [
"MIT"
] | 1 | 2019-11-05T11:09:37.000Z | 2019-11-05T11:09:37.000Z | import keras
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
from unet3d.data import open_data_file
import time
import gc
from multiprocessing import Pool
from functools import partial
from unet3d.generator import data_generator
from unet3d.generator import create_patch_index_list
import co... | 37.992958 | 143 | 0.660426 | import keras
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
from unet3d.data import open_data_file
import time
import gc
from multiprocessing import Pool
from functools import partial
from unet3d.generator import data_generator
from unet3d.generator import create_patch_index_list
import co... | true | true |
1c381f6a9084179035025feb20906ae1aab51330 | 2,166 | py | Python | dockerfiles/rdpesr/add_RD_to_SVs.py | guoxueyu/gatk-sv | 22fc647dd3ee56a47cb0523ea8f6cc37c4b904eb | [
"BSD-3-Clause"
] | null | null | null | dockerfiles/rdpesr/add_RD_to_SVs.py | guoxueyu/gatk-sv | 22fc647dd3ee56a47cb0523ea8f6cc37c4b904eb | [
"BSD-3-Clause"
] | null | null | null | dockerfiles/rdpesr/add_RD_to_SVs.py | guoxueyu/gatk-sv | 22fc647dd3ee56a47cb0523ea8f6cc37c4b904eb | [
"BSD-3-Clause"
] | null | null | null | #script to add cov to SVs
def add_ILL_cov(pb_uni_svs,bincov):
for i in pb_uni_svs.keys():
for j in pb_uni_svs[i]:
cov_list=cov_SV_readin(j, bincov)
if len(cov_list)>0:
j+=[len(cov_list),np.median(cov_list), np.mean(... | 33.84375 | 106 | 0.537396 |
def add_ILL_cov(pb_uni_svs,bincov):
for i in pb_uni_svs.keys():
for j in pb_uni_svs[i]:
cov_list=cov_SV_readin(j, bincov)
if len(cov_list)>0:
j+=[len(cov_list),np.median(cov_list), np.mean(cov_list),np.std(cov_list)... | true | true |
1c38217e0b61df6b7eff884266d12fc60cb0b73a | 1,261 | py | Python | src/Maze.py | Utsav-Patel/The-Imitation-Game | 09dfaffdf917c1adfb1d8cd3e09a216b9a014e52 | [
"MIT"
] | null | null | null | src/Maze.py | Utsav-Patel/The-Imitation-Game | 09dfaffdf917c1adfb1d8cd3e09a216b9a014e52 | [
"MIT"
] | null | null | null | src/Maze.py | Utsav-Patel/The-Imitation-Game | 09dfaffdf917c1adfb1d8cd3e09a216b9a014e52 | [
"MIT"
] | null | null | null | import numpy as np
from constants import UNVISITED_NUMBER
from src.Node import Node
class Maze:
def __init__(self, num_cols: int, num_rows: int):
self.num_cols = num_cols
self.num_rows = num_rows
self.maze_numpy = np.zeros((num_rows, num_cols)) + UNVISITED_NUMBER
self.num_times_c... | 32.333333 | 103 | 0.613006 | import numpy as np
from constants import UNVISITED_NUMBER
from src.Node import Node
class Maze:
def __init__(self, num_cols: int, num_rows: int):
self.num_cols = num_cols
self.num_rows = num_rows
self.maze_numpy = np.zeros((num_rows, num_cols)) + UNVISITED_NUMBER
self.num_times_c... | true | true |
1c3821ff5204a4bd0547f2cc0981f29b15959b35 | 3,649 | py | Python | backend/app/app/api/api_v1/endpoints/role.py | data-python/vue-element-admin-fastapi | 1ef2935bf18b6965f168d6091b7eabaded619b9b | [
"MIT"
] | 137 | 2020-08-06T17:00:50.000Z | 2022-03-28T02:38:23.000Z | backend/app/app/api/api_v1/endpoints/role.py | data-python/vue-element-admin-fastapi | 1ef2935bf18b6965f168d6091b7eabaded619b9b | [
"MIT"
] | 3 | 2020-08-16T14:32:38.000Z | 2021-02-07T11:31:06.000Z | backend/app/app/api/api_v1/endpoints/role.py | data-python/vue-element-admin-fastapi | 1ef2935bf18b6965f168d6091b7eabaded619b9b | [
"MIT"
] | 36 | 2020-08-07T01:34:22.000Z | 2022-03-31T04:55:41.000Z | from typing import Any
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session, joinedload
from app import models, schemas
from app.api import deps
from app.extensions.utils import list_to_tree, dfs_tree_to_list
router = APIRouter()
@router.get("/routes", response_model=schemas.Response)
def route... | 36.49 | 120 | 0.636339 | from typing import Any
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session, joinedload
from app import models, schemas
from app.api import deps
from app.extensions.utils import list_to_tree, dfs_tree_to_list
router = APIRouter()
@router.get("/routes", response_model=schemas.Response)
def route... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.