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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75df0db2972f3829fed0d52f3287c67e8319ffe | 1,930 | py | Python | aasaan/config/management/commands/notify_program_cancellation.py | deepakkt/aasaan | 77ef72e785e6ae562f51ae64fa9d85faf860c315 | [
"MIT"
] | null | null | null | aasaan/config/management/commands/notify_program_cancellation.py | deepakkt/aasaan | 77ef72e785e6ae562f51ae64fa9d85faf860c315 | [
"MIT"
] | 15 | 2020-06-05T19:26:26.000Z | 2022-03-11T23:33:53.000Z | aasaan/config/management/commands/notify_program_cancellation.py | deepakkt/aasaan | 77ef72e785e6ae562f51ae64fa9d85faf860c315 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import date, datetime
from django.core.management.base import BaseCommand
from django.conf import settings
from schedulemaster.models import ProgramSchedule
from config.models import get_configurations
from utils.datedeux import DateDeux
import sendgrid
from .notify... | 40.208333 | 91 | 0.622798 | from datetime import date, datetime
from django.core.management.base import BaseCommand
from django.conf import settings
from schedulemaster.models import ProgramSchedule
from config.models import get_configurations
from utils.datedeux import DateDeux
import sendgrid
from .notify_utils import setup_sendg... | true | true |
f75df10042460549f41fded81766bbdf1f163365 | 2,175 | py | Python | src/python/grpcio/grpc/framework/foundation/logging_pool.py | txl0591/grpc | 8b732dc466fb8a567c1bca9dbb84554d29087395 | [
"Apache-2.0"
] | 117 | 2017-10-02T21:34:35.000Z | 2022-03-02T01:49:03.000Z | src/python/grpcio/grpc/framework/foundation/logging_pool.py | txl0591/grpc | 8b732dc466fb8a567c1bca9dbb84554d29087395 | [
"Apache-2.0"
] | 13 | 2020-01-28T22:20:14.000Z | 2022-03-11T23:20:14.000Z | src/python/grpcio/grpc/framework/foundation/logging_pool.py | txl0591/grpc | 8b732dc466fb8a567c1bca9dbb84554d29087395 | [
"Apache-2.0"
] | 24 | 2017-10-31T12:14:15.000Z | 2021-12-11T10:07:46.000Z | # Copyright 2015 gRPC 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 law or agreed to in writing... | 31.071429 | 81 | 0.697011 |
import logging
from concurrent import futures
def _wrap(behavior):
def _wrapping(*args, **kwargs):
try:
return behavior(*args, **kwargs)
except Exception:
logging.exception(
'Unexpected exception from %s executed in logging pool!',
behavio... | true | true |
f75df1abae783742aa59500f656846396ae8e5fc | 2,332 | py | Python | itim-reencrypter-PBEtoAES.py | alexivkin/ISIM-Crypto-Seer | c732f1d2717d51d0254a30619350cde1e82a96fe | [
"Apache-2.0"
] | 7 | 2017-07-07T02:31:33.000Z | 2021-07-30T12:15:02.000Z | itim-reencrypter-PBEtoAES.py | alexivkin/ISIM-Crypto-Seer | c732f1d2717d51d0254a30619350cde1e82a96fe | [
"Apache-2.0"
] | 1 | 2018-06-29T23:58:38.000Z | 2018-06-30T05:55:32.000Z | itim-reencrypter-PBEtoAES.py | alexivkin/ISIM-Crypto-Seer | c732f1d2717d51d0254a30619350cde1e82a96fe | [
"Apache-2.0"
] | 3 | 2019-03-24T19:41:59.000Z | 2021-01-14T05:44:51.000Z | #!/usr/bin/python3
'''
Convert PBEWithMD5AndDES to AES/ECB/PKCS5Padding (Oracle JDK 6 and 7 use AES/ECB/PKCS5Padding when only AES is specified)
Gimme a base 64 encoded value you want to <decode>, a <password> for the decryption an a base64 encoded <key> for encryption
For ISIM the encryption/decryption password is e... | 36.4375 | 162 | 0.682676 | import base64,sys
from Crypto.Hash import MD5,SHA256
from Crypto.Cipher import DES,AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
d_salt = "\xC7\x73\x21\x8C\x7E\xC8\xEE\x99"
def unpad_pkcs7(text, blocklength=16):
full_len = len(text)
pad_val = text[-1]
pos = full_len - pad_val
... | true | true |
f75df2270391978d014cc7f95b28276b60caba78 | 856 | py | Python | medium/python/c0339_739_daily-temperatures/00_leetcode_0339.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python/c0339_739_daily-temperatures/00_leetcode_0339.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python/c0339_739_daily-temperatures/00_leetcode_0339.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | 3 | 2018-02-09T02:46:48.000Z | 2021-02-20T08:32:03.000Z | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#739. Daily Temperatures
#Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wa... | 50.352941 | 228 | 0.709112 | # :type temperatures: List[int]
# :rtype: List[int]
# """
| true | true |
f75df2c5678e77f31439fa592c709942c17866f9 | 4,269 | py | Python | python_model.py | ivmfnal/python_model | 37be0df7d58b5ad25df8d4d4cabe77129d405b05 | [
"BSD-3-Clause"
] | null | null | null | python_model.py | ivmfnal/python_model | 37be0df7d58b5ad25df8d4d4cabe77129d405b05 | [
"BSD-3-Clause"
] | null | null | null | python_model.py | ivmfnal/python_model | 37be0df7d58b5ad25df8d4d4cabe77129d405b05 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import json
def softmax(x):
x = x - np.max(x, axis=-1, keepdims=True)
expx = np.exp(x)
return expx/np.sum(expx, axis=-1, keepdims=True)
def sigmoid(x):
return 1.0/(1.0 + np.exp(-x))
def tanh(x):
return sigmoid(2*x)*2-1
def relu(x):
return (x+np.abs(x))/2
activ... | 30.06338 | 104 | 0.548138 | import numpy as np
import json
def softmax(x):
x = x - np.max(x, axis=-1, keepdims=True)
expx = np.exp(x)
return expx/np.sum(expx, axis=-1, keepdims=True)
def sigmoid(x):
return 1.0/(1.0 + np.exp(-x))
def tanh(x):
return sigmoid(2*x)*2-1
def relu(x):
return (x+np.abs(x))/2
activ... | true | true |
f75df34be49c5a3bc0a5f3c2fd2b8acbee9de33d | 192 | py | Python | src/template.py | jhji-soochow/MAIN | 69386db371df1fe4007775246ffdda47af7e27ad | [
"MIT"
] | 2 | 2021-03-24T02:21:12.000Z | 2021-12-06T04:46:48.000Z | src/template.py | jhji-soochow/MAIN | 69386db371df1fe4007775246ffdda47af7e27ad | [
"MIT"
] | null | null | null | src/template.py | jhji-soochow/MAIN | 69386db371df1fe4007775246ffdda47af7e27ad | [
"MIT"
] | null | null | null | def set_template(args):
# Set the templates here
if args.template.find('AIN') >=0:
args.model = 'AIN'
if args.template.find('AIN2') >= 0:
args.model = 'AIN2'
| 21.333333 | 39 | 0.5625 | def set_template(args):
if args.template.find('AIN') >=0:
args.model = 'AIN'
if args.template.find('AIN2') >= 0:
args.model = 'AIN2'
| true | true |
f75df3ab21cf496130e08be3028aac00312d71e6 | 508 | py | Python | pyfr/solvers/__init__.py | tjcorona/PyFR | a72b41580043bb001e5a9e6bb79a0e305d48e052 | [
"BSD-3-Clause"
] | null | null | null | pyfr/solvers/__init__.py | tjcorona/PyFR | a72b41580043bb001e5a9e6bb79a0e305d48e052 | [
"BSD-3-Clause"
] | null | null | null | pyfr/solvers/__init__.py | tjcorona/PyFR | a72b41580043bb001e5a9e6bb79a0e305d48e052 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from pyfr.integrators import get_integrator
from pyfr.solvers.base import BaseSystem
from pyfr.solvers.euler import EulerSystem
from pyfr.solvers.navstokes import NavierStokesSystem
from pyfr.util import subclass_where
def get_solver(backend, rallocs, mesh, initsoln, cfg):
systemcls = sub... | 33.866667 | 76 | 0.777559 |
from pyfr.integrators import get_integrator
from pyfr.solvers.base import BaseSystem
from pyfr.solvers.euler import EulerSystem
from pyfr.solvers.navstokes import NavierStokesSystem
from pyfr.util import subclass_where
def get_solver(backend, rallocs, mesh, initsoln, cfg):
systemcls = subclass_where(BaseSystem, ... | true | true |
f75df3f5f8fa31110978c719ededf51f24deb82b | 4,269 | py | Python | gridworld/algorithms/ranking_cost/show_weight.py | TARTRL/RankingCost | 4ac7faebf006d1143b98a6eada651bcab6ec5063 | [
"MIT"
] | 3 | 2021-12-28T11:57:06.000Z | 2022-03-27T14:18:35.000Z | gridworld/algorithms/ranking_cost/show_weight.py | TARTRL/RankingCost | 4ac7faebf006d1143b98a6eada651bcab6ec5063 | [
"MIT"
] | null | null | null | gridworld/algorithms/ranking_cost/show_weight.py | TARTRL/RankingCost | 4ac7faebf006d1143b98a6eada651bcab6ec5063 | [
"MIT"
] | 3 | 2021-10-18T03:07:52.000Z | 2022-03-21T02:04:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 The TARTRL 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 38.809091 | 80 | 0.595221 |
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
def save_cost_maps(save_dir, name, weight):
heat_maps = weight[1]
for h_i, heat_map in enumerate(heat_maps):
fig, ax = plt.subplots(1, 1, figsize=(15, 15))
im = ax.imshow(heat_map)
cbar = ax.figure.colorbar(... | true | true |
f75df4528fbae9b590d1318f2051612719057b90 | 7,893 | py | Python | timesketch/lib/analyzers/similarity_scorer.py | shortstack/timesketch | ef2ed25ad11cb253bc719f42fa4a84dd9574cba5 | [
"Apache-2.0"
] | null | null | null | timesketch/lib/analyzers/similarity_scorer.py | shortstack/timesketch | ef2ed25ad11cb253bc719f42fa4a84dd9574cba5 | [
"Apache-2.0"
] | null | null | null | timesketch/lib/analyzers/similarity_scorer.py | shortstack/timesketch | ef2ed25ad11cb253bc719f42fa4a84dd9574cba5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.021552 | 80 | 0.637147 |
from __future__ import unicode_literals
import re
from flask import current_app
from datasketch.minhash import MinHash
from datasketch.lsh import MinHashLSH
from timesketch.lib.analyzers import interface
from timesketch.lib.analyzers import manager
class SimilarityScorerConfig(object):
DEFAULT_THRESHOLD ... | true | true |
f75df600b18784e42ba8c266f1ce95f370046ec7 | 1,778 | py | Python | tests/functional/arno/optimizer/test_opt_inner_join_merge_01.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/functional/arno/optimizer/test_opt_inner_join_merge_01.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/functional/arno/optimizer/test_opt_inner_join_merge_01.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: functional.arno.optimizer.opt_inner_join_merge_01
# title: INNER JOIN join merge
# decription: X JOIN Y ON (X.Field = Y.Field)
# When no index can be used on a INNER JOIN and there's a relation setup between X and Y then a MERGE should be performed.
# tracker_id: ... | 20.204545 | 136 | 0.681102 | # tracker_id:
# min_versions: []
# versions: 3.0
# qmid: functional.arno.optimizer.opt_inner_join_merge_01
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 3.0
# resources: None
substitutions_1 = []
init_script_1 = """CREATE TABLE Table_10 (
ID INTEGER NOT NULL
);
CREA... | true | true |
f75df69d7a63e4d2b5824bef6637172a820cf1b2 | 2,844 | py | Python | superset/explore/permalink/commands/get.py | nieaijun99/superset | 86368dd406b9e828f31186a4b6179d24758a7d87 | [
"Apache-2.0"
] | 2 | 2021-12-21T15:57:16.000Z | 2022-01-31T02:22:02.000Z | superset/explore/permalink/commands/get.py | nieaijun99/superset | 86368dd406b9e828f31186a4b6179d24758a7d87 | [
"Apache-2.0"
] | null | null | null | superset/explore/permalink/commands/get.py | nieaijun99/superset | 86368dd406b9e828f31186a4b6179d24758a7d87 | [
"Apache-2.0"
] | 2 | 2021-12-21T13:41:18.000Z | 2021-12-26T22:16:43.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... | 41.823529 | 88 | 0.7282 | import logging
from typing import Optional
from flask_appbuilder.security.sqla.models import User
from sqlalchemy.exc import SQLAlchemyError
from superset.datasets.commands.exceptions import DatasetNotFoundError
from superset.explore.permalink.commands.base import BaseExplorePermalinkCommand
from superset.explore.per... | true | true |
f75df6a017ade7265c81491a934b10a9633bfa19 | 14,777 | py | Python | presscontrol/process_link.py | ebravofm/PressControl | c8fffb5339f7673093f2fcf350680df71d9ad92d | [
"MIT"
] | null | null | null | presscontrol/process_link.py | ebravofm/PressControl | c8fffb5339f7673093f2fcf350680df71d9ad92d | [
"MIT"
] | null | null | null | presscontrol/process_link.py | ebravofm/PressControl | c8fffb5339f7673093f2fcf350680df71d9ad92d | [
"MIT"
] | null | null | null | import requests
from urllib.parse import urlparse
from bs4 import BeautifulSoup as bs
from presscontrol.utils import tprint, read_cookies
from presscontrol.config import config
import pandas as pd
import random
import urllib
import newspaper
from urllib.parse import urlparse
import datetime
from googlesearch import sea... | 32.476923 | 187 | 0.544969 | import requests
from urllib.parse import urlparse
from bs4 import BeautifulSoup as bs
from presscontrol.utils import tprint, read_cookies
from presscontrol.config import config
import pandas as pd
import random
import urllib
import newspaper
from urllib.parse import urlparse
import datetime
from googlesearch import sea... | true | true |
f75df6e4ce7ec35cf59e4246414d153be6a7b0d3 | 2,501 | py | Python | build/lib/atmos_sci/mplnet.py | dkllrjr/PyKeller | 6788876a0ab273c19e1643d7bce637f6e700eb99 | [
"MIT"
] | null | null | null | build/lib/atmos_sci/mplnet.py | dkllrjr/PyKeller | 6788876a0ab273c19e1643d7bce637f6e700eb99 | [
"MIT"
] | null | null | null | build/lib/atmos_sci/mplnet.py | dkllrjr/PyKeller | 6788876a0ab273c19e1643d7bce637f6e700eb99 | [
"MIT"
] | null | null | null | #NASA MPLNET functions
import numpy as np
import os
os.chdir('..')
os.chdir('..')
import PyKeller.signal_processing.pycuda_wavelets as py_wv
import PyKeller.signal_processing.wavelets as wv
import PyKeller.signal_processing.signal_analysis as sa
import PyKeller.atmos_sci.met_analysis as ma
import matplotlib.pyplot as ... | 30.5 | 124 | 0.627749 |
import numpy as np
import os
os.chdir('..')
os.chdir('..')
import PyKeller.signal_processing.pycuda_wavelets as py_wv
import PyKeller.signal_processing.wavelets as wv
import PyKeller.signal_processing.signal_analysis as sa
import PyKeller.atmos_sci.met_analysis as ma
import matplotlib.pyplot as plt
from scipy import s... | true | true |
f75df7a7b1a2514a75e6afa6e3f9bc626619e7e6 | 1,874 | py | Python | setup.py | tiagocordeiro/dj3-cloudinary-storage | 2267a35bc414aa96fb81791d01b831fc2a0bbb6f | [
"MIT"
] | 10 | 2020-04-20T07:27:34.000Z | 2022-01-19T11:33:05.000Z | setup.py | tiagocordeiro/dj3-cloudinary-storage | 2267a35bc414aa96fb81791d01b831fc2a0bbb6f | [
"MIT"
] | 83 | 2020-03-05T15:59:35.000Z | 2022-03-12T00:18:07.000Z | setup.py | tiagocordeiro/dj3-cloudinary-storage | 2267a35bc414aa96fb81791d01b831fc2a0bbb6f | [
"MIT"
] | 1 | 2020-04-07T17:08:00.000Z | 2020-04-07T17:08:00.000Z | import codecs
import os
from os import path
from setuptools import setup
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
description = (
"Django package that provides Cloudinary storages for both media and "
"static files as well as management commands for rem... | 30.721311 | 77 | 0.654749 | import codecs
import os
from os import path
from setuptools import setup
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
description = (
"Django package that provides Cloudinary storages for both media and "
"static files as well as management commands for rem... | true | true |
f75df8d5ecf3e5ecca0509700dd323c88e97d0ad | 7,710 | py | Python | blobcity/utils/AutoFeatureSelection.py | aadityasinha-dotcom/autoai | 600934c172f3c7f8bf8aa17fcc5b877d6bd628e3 | [
"Apache-2.0"
] | null | null | null | blobcity/utils/AutoFeatureSelection.py | aadityasinha-dotcom/autoai | 600934c172f3c7f8bf8aa17fcc5b877d6bd628e3 | [
"Apache-2.0"
] | null | null | null | blobcity/utils/AutoFeatureSelection.py | aadityasinha-dotcom/autoai | 600934c172f3c7f8bf8aa17fcc5b877d6bd628e3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 BlobCity, 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 writing,... | 42.596685 | 159 | 0.667834 |
import numpy as np
import pandas as pd
from sklearn.feature_selection import VarianceThreshold,SelectKBest,f_regression,f_classif
from sklearn.preprocessing import MinMaxScaler
from statistics import mean
from blobcity.utils.Cleaner import dataCleaner
class AutoFeatureSelection:
def dropHighCorrelationFeatures... | true | true |
f75dfa133a90c17bd992b3fab1c020d00c5af5d0 | 1,168 | py | Python | utils/timer.py | FloweryK/PickyCam-server | d1d293903f90def3c6ff4435443a2710907997ff | [
"MIT"
] | 1 | 2021-08-04T04:24:32.000Z | 2021-08-04T04:24:32.000Z | utils/timer.py | FloweryK/focus-on-you | faefe057cbf67aa2cdbaff77970777022190890a | [
"MIT"
] | null | null | null | utils/timer.py | FloweryK/focus-on-you | faefe057cbf67aa2cdbaff77970777022190890a | [
"MIT"
] | null | null | null | import time
import platform
class Timer:
def __init__(self):
self.time = []
self.name = []
self.history = {}
def initialize(self):
for i in range(1, len(self.time)):
name = self.name[i]
interval = self.time[i] - self.time[i - 1]
try:
... | 25.955556 | 74 | 0.517979 | import time
import platform
class Timer:
def __init__(self):
self.time = []
self.name = []
self.history = {}
def initialize(self):
for i in range(1, len(self.time)):
name = self.name[i]
interval = self.time[i] - self.time[i - 1]
try:
... | true | true |
f75dfa167dc8797936a0af8df121156c060b3451 | 7,347 | py | Python | cvapp/settings.py | altran/Awesome-Competence-System | 04c41c3e516f254440402cb27cc952b5415be816 | [
"Apache-2.0"
] | 1 | 2018-11-13T08:01:11.000Z | 2018-11-13T08:01:11.000Z | cvapp/settings.py | Cantara/Awesome-Competence-System-ACS | b79740c4459c0a9d5a7989544724e96b1fa90707 | [
"Apache-2.0"
] | 1 | 2015-02-02T14:14:22.000Z | 2015-02-02T14:14:22.000Z | cvapp/settings.py | Cantara/Awesome-Competence-System-ACS | b79740c4459c0a9d5a7989544724e96b1fa90707 | [
"Apache-2.0"
] | 2 | 2015-01-30T17:00:03.000Z | 2020-04-23T23:54:25.000Z | # Django settings for cvapp project.
try:
from localsettings import *
except ImportError:
pass
import os
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
WWW_ROOT = '/var/www/'
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_nam... | 30.869748 | 88 | 0.673336 |
try:
from localsettings import *
except ImportError:
pass
import os
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
WWW_ROOT = '/var/www/'
TIME_ZONE = 'Europe/Oslo'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
MEDIA_ROOT = WWW_ROOT + '/media/'
MEDIA_URL ... | true | true |
f75dfa36906a9f820ab88cdbaa9ce995e516643b | 351 | py | Python | frontend/migrations/0002_delete_history.py | roman-baldaev/test-task-weather | 114048583bc106ad082dcd6efe8d966f76cd476e | [
"MIT"
] | null | null | null | frontend/migrations/0002_delete_history.py | roman-baldaev/test-task-weather | 114048583bc106ad082dcd6efe8d966f76cd476e | [
"MIT"
] | 2 | 2020-02-12T00:15:20.000Z | 2020-06-05T18:02:22.000Z | frontend/migrations/0002_delete_history.py | roman-baldaev/test-task-weather | 114048583bc106ad082dcd6efe8d966f76cd476e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-05 08:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('frontend', '0001_initial'),
]
operations = [
migrations.DeleteModel(
na... | 18.473684 | 48 | 0.615385 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('frontend', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='History',
),
]
| true | true |
f75dfa48b6ec7f6a5966f739f4f3d6fbf8aa255c | 606 | py | Python | djangoprojects/djangoprojects/fbvCRUD/fbvApp/migrations/0001_initial.py | PacktPublishing/Django-for-Python-Developers | acc3abe3b7817ce8ea6a133a2f9bb9e2923f9034 | [
"MIT"
] | 3 | 2021-10-02T03:20:06.000Z | 2021-10-17T01:52:06.000Z | djangoprojects/djangoprojects/fbvCRUD/fbvApp/migrations/0001_initial.py | PacktPublishing/Django-for-Python-Developers | acc3abe3b7817ce8ea6a133a2f9bb9e2923f9034 | [
"MIT"
] | null | null | null | djangoprojects/djangoprojects/fbvCRUD/fbvApp/migrations/0001_initial.py | PacktPublishing/Django-for-Python-Developers | acc3abe3b7817ce8ea6a133a2f9bb9e2923f9034 | [
"MIT"
] | 8 | 2019-12-24T18:44:05.000Z | 2022-02-22T18:34:54.000Z | # Generated by Django 2.2.2 on 2019-07-18 09:07
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Student',
fields=[
('id', models.AutoField(... | 25.25 | 114 | 0.567657 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Student',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=F... | true | true |
f75dfa5dbfe60ab365401843428f258aef340a3a | 1,069 | py | Python | Gender_Classifier.py | shantanu-garg/Data_Science_Projects | 2c4287dff9e624644ce4c8dc520b83c74a6555ee | [
"Apache-2.0"
] | null | null | null | Gender_Classifier.py | shantanu-garg/Data_Science_Projects | 2c4287dff9e624644ce4c8dc520b83c74a6555ee | [
"Apache-2.0"
] | null | null | null | Gender_Classifier.py | shantanu-garg/Data_Science_Projects | 2c4287dff9e624644ce4c8dc520b83c74a6555ee | [
"Apache-2.0"
] | null | null | null | from sklearn import tree
from sklearn import ensemble
from sklearn import neighbors
from sklearn import neural_network
#X = [height, weight, shoe size]
X = [[190,80,10],[132,45,6],[189,67,9],[202,100,13],[145,67,6],[154,45,8],[148,89,9],[159,90,7],[188,78,12],[163,80,8]]
Y =['Female','Male','Male','Male','Female','F... | 23.755556 | 119 | 0.718428 | from sklearn import tree
from sklearn import ensemble
from sklearn import neighbors
from sklearn import neural_network
X = [[190,80,10],[132,45,6],[189,67,9],[202,100,13],[145,67,6],[154,45,8],[148,89,9],[159,90,7],[188,78,12],[163,80,8]]
Y =['Female','Male','Male','Male','Female','Female','Male','Female','Female','... | true | true |
f75dfb4460586fd55c96be5988df701f6c96517d | 2,269 | py | Python | tests/libraries/xmlwriter.py | MoonStarCZW/py2rb | 89b247717d33d780fbf143e1583bfe9252984da4 | [
"MIT"
] | 124 | 2017-08-19T05:37:16.000Z | 2022-03-08T18:24:18.000Z | tests/libraries/xmlwriter.py | MoonStarCZW/py2rb | 89b247717d33d780fbf143e1583bfe9252984da4 | [
"MIT"
] | 15 | 2017-12-16T05:59:31.000Z | 2022-02-08T02:51:17.000Z | tests/libraries/xmlwriter.py | MoonStarCZW/py2rb | 89b247717d33d780fbf143e1583bfe9252984da4 | [
"MIT"
] | 18 | 2017-09-25T11:57:04.000Z | 2022-02-19T17:33:48.000Z |
class StringWriter(object):
def __init__(self):
self.contents = ''
def write(self,text):
self.contents += text
def getContents(self):
return self.contents
class XmlWriter(object):
class Node(object):
def __init__(self):
pass
class TextNode(Node):
... | 24.663043 | 63 | 0.526223 |
class StringWriter(object):
def __init__(self):
self.contents = ''
def write(self,text):
self.contents += text
def getContents(self):
return self.contents
class XmlWriter(object):
class Node(object):
def __init__(self):
pass
class TextNode(Node):
... | true | true |
f75dfbe1587192bdb030fc2f27e86c6f87d0c94e | 3,620 | py | Python | chp/coulomb/errors.py | di2ag/bkb-pathway-provider | 42824f22868c5c5d777da3facb4209744bcc6f96 | [
"MIT"
] | null | null | null | chp/coulomb/errors.py | di2ag/bkb-pathway-provider | 42824f22868c5c5d777da3facb4209744bcc6f96 | [
"MIT"
] | 7 | 2021-01-13T22:25:46.000Z | 2021-07-29T15:26:06.000Z | chp/coulomb/errors.py | NCATSTranslator/chp | 00668fd3d50a48fdd75abbeacaf173a3ad41942d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:06:24.000Z | 2021-01-26T15:02:12.000Z | ###########################################
# General Trapi Handler Exceptions
###########################################
class UnidentifiedQueryType(Exception):
def __str__(self):
return 'Unidentified query type. Please see https://github.com/di2ag/chp_client for details on our query types.'
class Unid... | 28.28125 | 136 | 0.628177 |
class UnidentifiedQueryType(Exception):
def __str__(self):
return 'Unidentified query type. Please see https://github.com/di2ag/chp_client for details on our query types.'
class UnidentifiedGeneCurie(Exception):
def __init__(self, *args):
self.curie = args[0]
def __str__(self):
... | true | true |
f75dfc5b339167d547f6be492865f4a12a6fbea4 | 13,175 | py | Python | .history/pages/postgres_20220308111702.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/postgres_20220308111702.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/postgres_20220308111702.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
page_title ='Postgres Cheatsheet for Python'
# st.set_page_config(
# page_title='Postgres Cheatsheet for Python',
# layout="wide",
# # initial_sidebar_state="expanded",
# )
def img_t... | 45.119863 | 236 | 0.417002 | import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
page_title ='Postgres Cheatsheet for Python'
def img_to_bytes(img_path):
img_bytes = Path(img_path).read_bytes()
encoded = base64.b64encode(img_bytes).decode()
return encoded
def cs_body():
... | false | true |
f75dfcdbfd33cde31ac362920b90e6a7785fb1c1 | 1,944 | py | Python | src/products/views.py | Chris-Ngu/DjangoEnviornment | 443f30f2088c5f7e11c3e909cc5bed06526ccc6a | [
"bzip2-1.0.6"
] | 1 | 2020-04-04T02:29:12.000Z | 2020-04-04T02:29:12.000Z | src/products/views.py | Chris-Ngu/DjangoEnviornment | 443f30f2088c5f7e11c3e909cc5bed06526ccc6a | [
"bzip2-1.0.6"
] | null | null | null | src/products/views.py | Chris-Ngu/DjangoEnviornment | 443f30f2088c5f7e11c3e909cc5bed06526ccc6a | [
"bzip2-1.0.6"
] | null | null | null | from django.http import Http404
from django.shortcuts import render, get_object_or_404, redirect
from .models import Product
from .forms import ProductForm, RawProductForm
def product_create_view(request):
form = ProductForm(request.POST or None)
if form.is_valid():
form.save()
form = ProductForm()
obj ... | 25.92 | 67 | 0.694959 | from django.http import Http404
from django.shortcuts import render, get_object_or_404, redirect
from .models import Product
from .forms import ProductForm, RawProductForm
def product_create_view(request):
form = ProductForm(request.POST or None)
if form.is_valid():
form.save()
form = ProductForm()
obj ... | true | true |
f75dfdc9f2097dec4578d804606d53096ee068d4 | 3,983 | py | Python | honkai3rd.py | lixiang1216/AutoMihoyoBBS | 5560bb845430bf281b80a9302b285d7ff21fa8aa | [
"MIT"
] | 1 | 2021-10-05T03:54:17.000Z | 2021-10-05T03:54:17.000Z | honkai3rd.py | lixiang1216/AutoMihoyoBBS | 5560bb845430bf281b80a9302b285d7ff21fa8aa | [
"MIT"
] | null | null | null | honkai3rd.py | lixiang1216/AutoMihoyoBBS | 5560bb845430bf281b80a9302b285d7ff21fa8aa | [
"MIT"
] | null | null | null | import time
import tools
import config
import random
import setting
from request import http
class honkai3rd:
def __init__(self) -> None:
self.headers = {
'Accept': 'application/json, text/plain, */*',
'DS': tools.Get_ds(web=True, web_old=True),
'Origin': 'ht... | 45.261364 | 244 | 0.558122 | import time
import tools
import config
import random
import setting
from request import http
class honkai3rd:
def __init__(self) -> None:
self.headers = {
'Accept': 'application/json, text/plain, */*',
'DS': tools.Get_ds(web=True, web_old=True),
'Origin': 'ht... | true | true |
f75dfde45e144796503436a11f672a46e0430e42 | 21,091 | py | Python | src/_pytest/cacheprovider.py | Exifers/pytest | c9870480e095aebefa3777e9f3d7d2533b0336bd | [
"MIT"
] | 1 | 2021-05-02T01:29:13.000Z | 2021-05-02T01:29:13.000Z | src/_pytest/cacheprovider.py | Exifers/pytest | c9870480e095aebefa3777e9f3d7d2533b0336bd | [
"MIT"
] | 17 | 2021-09-06T03:07:30.000Z | 2022-03-28T03:10:23.000Z | src/_pytest/cacheprovider.py | Exifers/pytest | c9870480e095aebefa3777e9f3d7d2533b0336bd | [
"MIT"
] | null | null | null | """Implementation of the cache provider."""
# This plugin was not named "cache" to avoid conflicts with the external
# pytest-cache version.
import json
import os
from pathlib import Path
from typing import Dict
from typing import Generator
from typing import Iterable
from typing import List
from typing import Optional... | 35.747458 | 117 | 0.614622 | import json
import os
from pathlib import Path
from typing import Dict
from typing import Generator
from typing import Iterable
from typing import List
from typing import Optional
from typing import Set
from typing import Union
import attr
from .pathlib import resolve_from_str
from .pathlib import rm_rf
from .reports... | true | true |
f75dfec3cb61d14d42cefee109842ad107c860cd | 9,883 | py | Python | struct2tensor/path.py | priyansh19/struct2tensor | 1b9ada0c4018323a0549cc13437c561d39a46a05 | [
"Apache-2.0"
] | 2 | 2019-07-25T12:53:00.000Z | 2019-08-18T16:26:13.000Z | struct2tensor/path.py | priyansh19/struct2tensor | 1b9ada0c4018323a0549cc13437c561d39a46a05 | [
"Apache-2.0"
] | null | null | null | struct2tensor/path.py | priyansh19/struct2tensor | 1b9ada0c4018323a0549cc13437c561d39a46a05 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 or agreed to in writing, ... | 29.858006 | 79 | 0.682789 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
from typing import Sequence, Tuple, Union
from tensorflow_metadata.proto.v0 import path_pb2 as tf_metadata_path_pb2
_EXTENSION_REGEX = r"""(?:\((?:[A-Za-z0-9_/\-]+\.)*[A-Za-z0-9_/\-]+\))"""
_SIMPL... | true | true |
f75dff5aeb5815377a599208d98488037cb600ba | 935 | py | Python | plugins/passwd/views.py | lllanos/InfraDocker_Ajenti | 3dc55744eb378bd25d0a8a814c79d5b9dd6f22cd | [
"MIT"
] | 1 | 2021-04-27T07:16:01.000Z | 2021-04-27T07:16:01.000Z | plugins/passwd/views.py | lllanos/InfraDocker_Ajenti | 3dc55744eb378bd25d0a8a814c79d5b9dd6f22cd | [
"MIT"
] | null | null | null | plugins/passwd/views.py | lllanos/InfraDocker_Ajenti | 3dc55744eb378bd25d0a8a814c79d5b9dd6f22cd | [
"MIT"
] | null | null | null | import pwd
import subprocess
from jadi import component
from aj.api.http import url, HttpPlugin
from aj.api.endpoint import endpoint
@component(HttpPlugin)
class Handler(HttpPlugin):
def __init__(self, context):
self.context = context
@url(r'/api/passwd/list')
@endpoint(api=True)
def handle... | 25.972222 | 65 | 0.568984 | import pwd
import subprocess
from jadi import component
from aj.api.http import url, HttpPlugin
from aj.api.endpoint import endpoint
@component(HttpPlugin)
class Handler(HttpPlugin):
def __init__(self, context):
self.context = context
@url(r'/api/passwd/list')
@endpoint(api=True)
def handle... | true | true |
f75dffbfbe61a7de28391c28b6a89acd7ac375cf | 811 | py | Python | var/spack/repos/builtin/packages/xrandr/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/xrandr/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/xrandr/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xrandr(AutotoolsPackage):
"""xrandr - primitive command line interface to X11 Resize, Rota... | 31.192308 | 77 | 0.701603 |
from spack import *
class Xrandr(AutotoolsPackage):
homepage = "http://cgit.freedesktop.org/xorg/app/xrandr"
url = "https://www.x.org/archive/individual/app/xrandr-1.5.0.tar.gz"
version('1.5.0', 'fe9cf76033fe5d973131eac67b6a3118')
depends_on('libxrandr@1.5:')
depends_on('libxrender')
... | true | true |
f75dffff6866d08d4f38288c18a4d4a17e708bf9 | 3,276 | py | Python | src/bonsai/asyncio/aiopool.py | cmalek/bonsai | f27cb2e5a1b7222d2b05b0f1ece733d67d9df448 | [
"MIT"
] | 59 | 2016-11-19T15:29:22.000Z | 2022-03-31T05:59:26.000Z | src/bonsai/asyncio/aiopool.py | cmalek/bonsai | f27cb2e5a1b7222d2b05b0f1ece733d67d9df448 | [
"MIT"
] | 54 | 2016-11-02T22:07:13.000Z | 2022-03-12T19:35:43.000Z | src/bonsai/asyncio/aiopool.py | cmalek/bonsai | f27cb2e5a1b7222d2b05b0f1ece733d67d9df448 | [
"MIT"
] | 17 | 2017-01-12T05:41:24.000Z | 2022-02-03T07:14:00.000Z | import asyncio
from ..pool import ConnectionPool, ClosedPool, EmptyPool
from .aioconnection import AIOLDAPConnection
MYPY = False
if MYPY:
from ..ldapclient import LDAPClient
class AIOPoolContextManager:
def __init__(self, pool, *args, **kwargs):
self.pool = pool
self.__conn = None
as... | 32.117647 | 82 | 0.580891 | import asyncio
from ..pool import ConnectionPool, ClosedPool, EmptyPool
from .aioconnection import AIOLDAPConnection
MYPY = False
if MYPY:
from ..ldapclient import LDAPClient
class AIOPoolContextManager:
def __init__(self, pool, *args, **kwargs):
self.pool = pool
self.__conn = None
as... | true | true |
f75e00820f3807fac95fde6a33a43c9a998771c0 | 4,216 | py | Python | utils/file.py | obss/turkish-question-generation | 5440a5e4bc9b89c322ffb502fbce1b60b396f235 | [
"MIT"
] | 18 | 2021-11-18T16:24:37.000Z | 2022-03-08T11:31:32.000Z | utils/file.py | obss/turkish-question-generation | 5440a5e4bc9b89c322ffb502fbce1b60b396f235 | [
"MIT"
] | null | null | null | utils/file.py | obss/turkish-question-generation | 5440a5e4bc9b89c322ffb502fbce1b60b396f235 | [
"MIT"
] | null | null | null | import json
import os
import urllib.request
import zipfile
from dataclasses import asdict
from pathlib import Path
from typing import Dict
import yaml
def safe_download(target_path: str, source_url: str, source_url2=None, min_bytes=1e0, error_msg="") -> None:
"""Attempts to download file from source_url or sourc... | 29.690141 | 119 | 0.666983 | import json
import os
import urllib.request
import zipfile
from dataclasses import asdict
from pathlib import Path
from typing import Dict
import yaml
def safe_download(target_path: str, source_url: str, source_url2=None, min_bytes=1e0, error_msg="") -> None:
file = Path(target_path)
assert_msg = f"Downloade... | true | true |
f75e00e6662d45988369ff170ab95711b32a01d0 | 6,243 | py | Python | saltfactories/utils/cli_scripts.py | danielrobbins/pytest-salt-factories | 9c9dc882628f6ddb93dab88bf548755d2196cec9 | [
"Apache-2.0"
] | null | null | null | saltfactories/utils/cli_scripts.py | danielrobbins/pytest-salt-factories | 9c9dc882628f6ddb93dab88bf548755d2196cec9 | [
"Apache-2.0"
] | null | null | null | saltfactories/utils/cli_scripts.py | danielrobbins/pytest-salt-factories | 9c9dc882628f6ddb93dab88bf548755d2196cec9 | [
"Apache-2.0"
] | null | null | null | """
saltfactories.utils.cli_scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code to generate Salt CLI scripts for test runs
"""
import logging
import pathlib
import stat
import textwrap
log = logging.getLogger(__name__)
SCRIPT_TEMPLATES = {
"salt": textwrap.dedent(
"""
import atexit
from salt.scr... | 31.371859 | 99 | 0.519782 | import logging
import pathlib
import stat
import textwrap
log = logging.getLogger(__name__)
SCRIPT_TEMPLATES = {
"salt": textwrap.dedent(
"""
import atexit
from salt.scripts import salt_main
if __name__ == '__main__':
exitcode = 0
try:
salt_... | true | true |
f75e01bb7b7b50fc6fdc29a5312c70e7b315fe6b | 3,882 | py | Python | editor/translations/extract.py | fossegutten/godot | f7715b58bded9d0402ddff3c7fb389344ee3591c | [
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-08-27T09:54:40.000Z | 2020-08-27T09:54:40.000Z | editor/translations/extract.py | fossegutten/godot | f7715b58bded9d0402ddff3c7fb389344ee3591c | [
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | null | null | null | editor/translations/extract.py | fossegutten/godot | f7715b58bded9d0402ddff3c7fb389344ee3591c | [
"CC-BY-3.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-08-27T09:54:49.000Z | 2020-08-27T09:54:49.000Z | #!/bin/python
import fnmatch
import os
import shutil
import subprocess
import sys
line_nb = False
for arg in sys.argv[1:]:
if (arg == "--with-line-nb"):
print("Enabling line numbers in the context locations.")
line_nb = True
else:
os.sys.exit("Non supported argument '" + arg + "'. Ab... | 31.560976 | 118 | 0.57187 |
import fnmatch
import os
import shutil
import subprocess
import sys
line_nb = False
for arg in sys.argv[1:]:
if (arg == "--with-line-nb"):
print("Enabling line numbers in the context locations.")
line_nb = True
else:
os.sys.exit("Non supported argument '" + arg + "'. Aborting.")
if... | true | true |
f75e01ccf2a1dc8db1a4e4f47f9c7b735f91af98 | 1,124 | py | Python | aioworkers_consul/__init__.py | aioworkers/aioworkers-consul | f2f472fb775f47e34b70a068e961ea5454f8a33a | [
"Apache-2.0"
] | null | null | null | aioworkers_consul/__init__.py | aioworkers/aioworkers-consul | f2f472fb775f47e34b70a068e961ea5454f8a33a | [
"Apache-2.0"
] | null | null | null | aioworkers_consul/__init__.py | aioworkers/aioworkers-consul | f2f472fb775f47e34b70a068e961ea5454f8a33a | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Any, Mapping
from aioworkers.core.config import ValueExtractor
from aioworkers.storage.http import Storage
BASE = Path(__file__).parent
configs = (BASE / "config.ini",)
class Client(Storage):
_service: Mapping[str, Any]
def set_config(self, config: ValueExtracto... | 29.578947 | 67 | 0.636121 | from pathlib import Path
from typing import Any, Mapping
from aioworkers.core.config import ValueExtractor
from aioworkers.storage.http import Storage
BASE = Path(__file__).parent
configs = (BASE / "config.ini",)
class Client(Storage):
_service: Mapping[str, Any]
def set_config(self, config: ValueExtracto... | true | true |
f75e021b3840424a04da5c65c15c7077d519d13e | 1,916 | py | Python | Linux-Android/File2Base64.py | Bravest-Ptt/Useful-Shell | 75016ff44f218afce6b885af7b23fb801a7ef2d4 | [
"Apache-2.0"
] | 1 | 2020-05-31T08:46:45.000Z | 2020-05-31T08:46:45.000Z | Linux-Android/File2Base64.py | Bravest-Ptt/Useful-Shell | 75016ff44f218afce6b885af7b23fb801a7ef2d4 | [
"Apache-2.0"
] | null | null | null | Linux-Android/File2Base64.py | Bravest-Ptt/Useful-Shell | 75016ff44f218afce6b885af7b23fb801a7ef2d4 | [
"Apache-2.0"
] | null | null | null | # coding=utf8
import base64
import sys
import os
def f2b(file_path):
try:
os.remove(file_path + "__base64")
except Exception as e:
pass
base64_str_file = open(file_path + "__base64", "wb")
print "Processing..."
try:
with open(file_path, "rb") as f:
... | 25.210526 | 75 | 0.477557 | import base64
import sys
import os
def f2b(file_path):
try:
os.remove(file_path + "__base64")
except Exception as e:
pass
base64_str_file = open(file_path + "__base64", "wb")
print "Processing..."
try:
with open(file_path, "rb") as f:
while Tru... | false | true |
f75e022b49875c50ad6987419e98fca77f9f0cef | 576 | py | Python | src/counttokens.py | Vnicius/filter | 0e478c5bc02c5152151308a1ca750c458c982135 | [
"MIT"
] | null | null | null | src/counttokens.py | Vnicius/filter | 0e478c5bc02c5152151308a1ca750c458c982135 | [
"MIT"
] | null | null | null | src/counttokens.py | Vnicius/filter | 0e478c5bc02c5152151308a1ca750c458c982135 | [
"MIT"
] | null | null | null | import sys
import re
if __name__ == "__main__":
file_name = sys.argv[1]
acc = []
punc = re.compile('([\.,\?!])')
with open(file_name, 'r', encoding="utf-8") as f:
while True:
sentence = f.readline().replace('\n', '')
if sentence:
sentence = punc.sub(r' \... | 25.043478 | 53 | 0.449653 | import sys
import re
if __name__ == "__main__":
file_name = sys.argv[1]
acc = []
punc = re.compile('([\.,\?!])')
with open(file_name, 'r', encoding="utf-8") as f:
while True:
sentence = f.readline().replace('\n', '')
if sentence:
sentence = punc.sub(r' \... | true | true |
f75e02b4c0ab9fd94402ddd86851846c99a4c17b | 47,670 | py | Python | tests/test_invoice.py | TenantBase/dj-stripe | c3fe9da9dd0e15fd714c95402b7672aac07d43e1 | [
"MIT"
] | null | null | null | tests/test_invoice.py | TenantBase/dj-stripe | c3fe9da9dd0e15fd714c95402b7672aac07d43e1 | [
"MIT"
] | null | null | null | tests/test_invoice.py | TenantBase/dj-stripe | c3fe9da9dd0e15fd714c95402b7672aac07d43e1 | [
"MIT"
] | null | null | null | """
dj-stripe Invoice Model Tests.
"""
from copy import deepcopy
from decimal import Decimal
from unittest.mock import ANY, patch
import pytest
import stripe
from django.contrib.auth import get_user_model
from django.test.testcases import TestCase
from stripe.error import InvalidRequestError
from djstripe.enums impor... | 33.523207 | 87 | 0.670862 | from copy import deepcopy
from decimal import Decimal
from unittest.mock import ANY, patch
import pytest
import stripe
from django.contrib.auth import get_user_model
from django.test.testcases import TestCase
from stripe.error import InvalidRequestError
from djstripe.enums import InvoiceStatus
from djstripe.models im... | true | true |
f75e0608f6001d77ced0c150b04e0f05df657fd3 | 407 | py | Python | Physics250-ME3738/spaceshipspeedRelativeToEarth.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | Physics250-ME3738/spaceshipspeedRelativeToEarth.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | Physics250-ME3738/spaceshipspeedRelativeToEarth.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | import math
speedofLight = 2.9979*pow(10,8)
def spaceShipSpeed():
firstLength = float(input('Input First Distance: '))
secondLength = float(input('Input Second Distance: '))
gamma = secondLength / firstLength
partone = (1-pow((1/gamma),2)) * pow(speedofLight, 2)
answer = math.sqrt(partone... | 22.611111 | 58 | 0.643735 | import math
speedofLight = 2.9979*pow(10,8)
def spaceShipSpeed():
firstLength = float(input('Input First Distance: '))
secondLength = float(input('Input Second Distance: '))
gamma = secondLength / firstLength
partone = (1-pow((1/gamma),2)) * pow(speedofLight, 2)
answer = math.sqrt(partone... | true | true |
f75e067f95c0adcef3b402cda3880d630caaec82 | 4,720 | py | Python | codalab/lib/formatting.py | kl-chou/codalab-worksheets | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | [
"Apache-2.0"
] | 236 | 2015-12-29T22:50:03.000Z | 2022-03-28T21:12:34.000Z | codalab/lib/formatting.py | kl-chou/codalab-worksheets | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | [
"Apache-2.0"
] | 2,628 | 2015-12-27T09:45:13.000Z | 2022-03-30T16:18:25.000Z | codalab/lib/formatting.py | kl-chou/codalab-worksheets | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | [
"Apache-2.0"
] | 87 | 2015-12-30T01:36:46.000Z | 2022-03-08T15:21:30.000Z | """
Provides basic formatting utilities.
"""
import datetime
import json
import shlex
import pipes
NONE_PLACEHOLDER = '<none>'
def contents_str(input_string, verbose=False):
"""
:param input_string: any string (may be None)
:param bool verbose: should use human-readable placeholders instead of empty
... | 23.718593 | 80 | 0.543644 |
import datetime
import json
import shlex
import pipes
NONE_PLACEHOLDER = '<none>'
def contents_str(input_string, verbose=False):
if input_string is None:
return NONE_PLACEHOLDER if verbose else ''
return str(input_string)
def verbose_contents_str(input_string):
return contents_str(input_strin... | true | true |
f75e068187c4a7dca298dfadcf457381c94b752b | 7,372 | py | Python | django/utils/termcolors.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/utils/termcolors.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/utils/termcolors.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-02-06T10:31:51.000Z | 2020-02-06T10:31:51.000Z | """
termcolors.py
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'reverse': '7', 'conce... | 34.12963 | 89 | 0.543136 |
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'reverse': '7', 'conceal': '8'}
def colori... | true | true |
f75e07cec7cbd9c044284eea8b5a8b8d812abae2 | 446 | py | Python | backend-django/prolibra/library_api/migrations/0021_alter_meminjam_status_peminjaman.py | dhifafaz/tubes-basdat | 49c100a1cda3a2eade54e7472bfceecee51e315b | [
"MIT"
] | null | null | null | backend-django/prolibra/library_api/migrations/0021_alter_meminjam_status_peminjaman.py | dhifafaz/tubes-basdat | 49c100a1cda3a2eade54e7472bfceecee51e315b | [
"MIT"
] | 1 | 2021-05-11T18:03:34.000Z | 2021-05-11T18:03:34.000Z | backend-django/prolibra/library_api/migrations/0021_alter_meminjam_status_peminjaman.py | dhifafaz/tubes-basdat | 49c100a1cda3a2eade54e7472bfceecee51e315b | [
"MIT"
] | 7 | 2021-04-26T15:52:19.000Z | 2021-05-04T02:18:56.000Z | # Generated by Django 3.2 on 2021-05-05 10:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('library_api', '0020_alter_meminjam_status_peminjaman'),
]
operations = [
migrations.AlterField(
model_name='meminjam',
... | 23.473684 | 81 | 0.641256 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('library_api', '0020_alter_meminjam_status_peminjaman'),
]
operations = [
migrations.AlterField(
model_name='meminjam',
name='status_peminjaman',
field=m... | true | true |
f75e0814abe19c64f6f510850e381751c2489b8d | 2,416 | py | Python | Tests/interop/net/field/test_fields_inside_enum.py | elfscript/ironpython3 | fde41d69ff178e60b33b68752e0ea8ba8f5e45e7 | [
"Apache-2.0"
] | null | null | null | Tests/interop/net/field/test_fields_inside_enum.py | elfscript/ironpython3 | fde41d69ff178e60b33b68752e0ea8ba8f5e45e7 | [
"Apache-2.0"
] | null | null | null | Tests/interop/net/field/test_fields_inside_enum.py | elfscript/ironpython3 | fde41d69ff178e60b33b68752e0ea8ba8f5e45e7 | [
"Apache-2.0"
] | null | null | null | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import unittest
from iptest import IronPythonTestCase, run_test, skipUnlessIronPython
@skipUnlessIronPython()
... | 37.75 | 134 | 0.598096 |
import unittest
from iptest import IronPythonTestCase, run_test, skipUnlessIronPython
@skipUnlessIronPython()
class FieldsInsideEnumTest(IronPythonTestCase):
def setUp(self):
super(FieldsInsideEnumTest, self).setUp()
self.add_clr_assemblies("fieldtests", "typesamples", "baseclasscs")
def tes... | true | true |
f75e0985d695a07a23e80c5ea723fbcfbbbacc30 | 18,101 | py | Python | glance/tests/unit/test_db_metadef.py | komawar/glance | e550cac697dd8c78e837c6884f599ac6ee2137ae | [
"Apache-2.0"
] | null | null | null | glance/tests/unit/test_db_metadef.py | komawar/glance | e550cac697dd8c78e837c6884f599ac6ee2137ae | [
"Apache-2.0"
] | null | null | null | glance/tests/unit/test_db_metadef.py | komawar/glance | e550cac697dd8c78e837c6884f599ac6ee2137ae | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation.
# Copyright 2014 Intel Corporation
# 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/lic... | 42.193473 | 79 | 0.624054 |
from glance.common import exception
from glance.common import utils
import glance.context
import glance.db
import glance.tests.unit.utils as unit_test_utils
import glance.tests.utils as test_utils
TENANT1 = '6838eb7b-6ded-434a-882c-b344c77fe8df'
TENANT2 = '2c014f32-55eb-467d-8fcb-4bd706012f81'
TENANT3 = '5a3e60e8-cfa... | true | true |
f75e0a6270b0e690266753ea4d5cea1d8721369d | 11,688 | py | Python | stonesoup/smoother/kalman.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | 1 | 2021-12-02T00:17:21.000Z | 2021-12-02T00:17:21.000Z | stonesoup/smoother/kalman.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | stonesoup/smoother/kalman.py | io8ex/Stone-Soup | 071abc8f6004296ab35094db04c7ec410103c419 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
from functools import partial
import numpy as np
from .base import Smoother
from ..base import Property
from ..types.multihypothesis import MultipleHypothesis
from ..types.prediction import Prediction, GaussianStatePrediction
from ..types.update import Update, GaussianStateUpdate
f... | 39.221477 | 99 | 0.626968 | import copy
from functools import partial
import numpy as np
from .base import Smoother
from ..base import Property
from ..types.multihypothesis import MultipleHypothesis
from ..types.prediction import Prediction, GaussianStatePrediction
from ..types.update import Update, GaussianStateUpdate
from ..models.base import... | true | true |
f75e0a9d708d9629cc343363ec8f72d7412b5650 | 6,615 | py | Python | scripts/activity.py | neherlab/HIVEVO_recombination | 3160d4396069c1a403a0a122d30e6c2f0522df5f | [
"MIT"
] | 1 | 2021-02-23T05:29:02.000Z | 2021-02-23T05:29:02.000Z | scripts/activity.py | neherlab/HIVEVO_recombination | 3160d4396069c1a403a0a122d30e6c2f0522df5f | [
"MIT"
] | null | null | null | scripts/activity.py | neherlab/HIVEVO_recombination | 3160d4396069c1a403a0a122d30e6c2f0522df5f | [
"MIT"
] | 1 | 2021-02-23T05:29:03.000Z | 2021-02-23T05:29:03.000Z | from trajectory import Trajectory, create_trajectory_list, filter, create_all_patient_trajectories
from hivevo.patients import Patient
import filenames
import matplotlib.pyplot as plt
import numpy as np
def get_activity(patient, region, normalize=False, remove_one_point_traj=False, min_freq=0.2):
time_bins = np.l... | 41.867089 | 170 | 0.66833 | from trajectory import Trajectory, create_trajectory_list, filter, create_all_patient_trajectories
from hivevo.patients import Patient
import filenames
import matplotlib.pyplot as plt
import numpy as np
def get_activity(patient, region, normalize=False, remove_one_point_traj=False, min_freq=0.2):
time_bins = np.l... | true | true |
f75e0ac14c59ce0465ad9044f4c26ccb34b12a49 | 398 | py | Python | csv_dat.py | HimanshuChourasia/Movie_Recommendations_Using_MRJob | c49a94635cd9916df6b36a72de117e00875e57f3 | [
"MIT"
] | null | null | null | csv_dat.py | HimanshuChourasia/Movie_Recommendations_Using_MRJob | c49a94635cd9916df6b36a72de117e00875e57f3 | [
"MIT"
] | null | null | null | csv_dat.py | HimanshuChourasia/Movie_Recommendations_Using_MRJob | c49a94635cd9916df6b36a72de117e00875e57f3 | [
"MIT"
] | null | null | null | import csv
with open('movies.dat','w') as out:
with open('movies.csv') as csvfile:
movie = csv.reader(csvfile)
for row in movie:
out.write("::".join(row) + '\n')
with open('ratings.dat','w') as out:
with open('ratings.csv') as csvfile:
ratings = csv.reader(csvfile)
for row in ratings:
if row[0] != 'user... | 30.615385 | 38 | 0.615578 | import csv
with open('movies.dat','w') as out:
with open('movies.csv') as csvfile:
movie = csv.reader(csvfile)
for row in movie:
out.write("::".join(row) + '\n')
with open('ratings.dat','w') as out:
with open('ratings.csv') as csvfile:
ratings = csv.reader(csvfile)
for row in ratings:
if row[0] != 'user... | true | true |
f75e0aee2a660471bfaa11be2f9c4fab9c560b22 | 1,194 | py | Python | utils/encryption.py | JiangFeng07/NLPIK | bacd52e24690e8ba706895b54a076ee05d785d7b | [
"Apache-2.0"
] | null | null | null | utils/encryption.py | JiangFeng07/NLPIK | bacd52e24690e8ba706895b54a076ee05d785d7b | [
"Apache-2.0"
] | null | null | null | utils/encryption.py | JiangFeng07/NLPIK | bacd52e24690e8ba706895b54a076ee05d785d7b | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/ python3
# -*- coding: utf-8 -*-
# @Time : 2022-03-01 17:17
# @Author : Leo
# -*- coding: utf-8 -*-
import base64
from Crypto.Cipher import AES
AES_SECRET_KEY = 'a' * 32 # 此处16|24|32个字符
IV = "1234567890123456"
# padding算法
BS = len(AES_SECRET_KEY)
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - l... | 26.533333 | 89 | 0.640704 |
import base64
from Crypto.Cipher import AES
AES_SECRET_KEY = 'a' * 32 IV = "1234567890123456"
BS = len(AES_SECRET_KEY)
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s: s[0:-ord(s[-1:])]
class AES_ENCRYPT(object):
@staticmethod
def encrypt(text):
cryptor = AES.n... | true | true |
f75e0b0b72eb342195d19f1fa0f626303bce3d36 | 5,408 | py | Python | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_secondary_pdn_with_dedicated_bearer_multi_ue.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_secondary_pdn_with_dedicated_bearer_multi_ue.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 14 | 2019-11-15T12:01:18.000Z | 2019-12-12T14:37:42.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_secondary_pdn_with_dedicated_bearer_multi_ue.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 3 | 2019-11-15T15:56:25.000Z | 2019-11-21T10:34:59.000Z | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import unittest
import time... | 35.346405 | 78 | 0.548447 |
import unittest
import time
import s1ap_types
import s1ap_wrapper
from integ_tests.s1aptests.s1ap_utils import SpgwUtil
class TestSecondaryPdnWithDedBearerMultiUe(unittest.TestCase):
def setUp(self):
self._s1ap_wrapper = s1ap_wrapper.TestWrapper()
self._spgw_util = SpgwUtil()
def tearDown(s... | true | true |
f75e0cd7ccc715eddad17dae40412f71df71eb61 | 473 | py | Python | tests/test_db_classes/test_withdraw.py | shaizamzaheer/bankapp | 5e290a0fe5a4ef9889a73514c58063bf7d44cd41 | [
"MIT"
] | null | null | null | tests/test_db_classes/test_withdraw.py | shaizamzaheer/bankapp | 5e290a0fe5a4ef9889a73514c58063bf7d44cd41 | [
"MIT"
] | 110 | 2021-11-16T03:24:28.000Z | 2022-03-31T02:25:44.000Z | tests/test_db_classes/test_withdraw.py | shaizamzaheer/bankapp | 5e290a0fe5a4ef9889a73514c58063bf7d44cd41 | [
"MIT"
] | null | null | null | from bankapp.bank_funcs import withdraw
from sqlalchemy import select
from bankapp.models import Account
import pytest
@pytest.mark.parametrize(
"acc,amount,expected",
[
(1_000_002, 400, 600_00),
],
)
def test_withdraw(dbsession, acc, amount, expected):
withdraw(account=acc, amount=amount)
... | 22.52381 | 71 | 0.672304 | from bankapp.bank_funcs import withdraw
from sqlalchemy import select
from bankapp.models import Account
import pytest
@pytest.mark.parametrize(
"acc,amount,expected",
[
(1_000_002, 400, 600_00),
],
)
def test_withdraw(dbsession, acc, amount, expected):
withdraw(account=acc, amount=amount)
... | true | true |
f75e0f26e53a32ae47a55b6062b21a7ff9a97e8d | 1,778 | py | Python | example/auto-battle-tower.py | nagata-yoshiteru/Switch-Fightstick | 66685ff57c09444675e24c37455107eb529ce98a | [
"MIT"
] | 1 | 2020-04-07T05:12:47.000Z | 2020-04-07T05:12:47.000Z | example/auto-battle-tower.py | nagata-yoshiteru/Switch-Fightstick | 66685ff57c09444675e24c37455107eb529ce98a | [
"MIT"
] | null | null | null | example/auto-battle-tower.py | nagata-yoshiteru/Switch-Fightstick | 66685ff57c09444675e24c37455107eb529ce98a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import serial
from time import sleep
parser = argparse.ArgumentParser()
parser.add_argument('--port', default='COM4')
args = parser.parse_args()
ser = serial.Serial(args.port, 9600)
def send(msg, duration=0):
global ser
try:
ser.write(f'{msg}\r\n'.encode('utf-8')... | 27.353846 | 176 | 0.498875 | import argparse
import serial
from time import sleep
parser = argparse.ArgumentParser()
parser.add_argument('--port', default='COM4')
args = parser.parse_args()
ser = serial.Serial(args.port, 9600)
def send(msg, duration=0):
global ser
try:
ser.write(f'{msg}\r\n'.encode('utf-8'))
print(msg.rep... | true | true |
f75e0f421b01ecc4983d62f8eee8ced7f60dc0c6 | 619 | py | Python | Track.py | seanth/nicecast-trackupdate | b3542c4c5e936486a722b7e6c715121cbec967ad | [
"MIT"
] | null | null | null | Track.py | seanth/nicecast-trackupdate | b3542c4c5e936486a722b7e6c715121cbec967ad | [
"MIT"
] | null | null | null | Track.py | seanth/nicecast-trackupdate | b3542c4c5e936486a722b7e6c715121cbec967ad | [
"MIT"
] | 1 | 2015-07-24T20:31:53.000Z | 2015-07-24T20:31:53.000Z | from dataclasses import dataclass
import os
@dataclass
class Track:
title: str
artist: str
album: str
length: str
artwork: str
artworkFilePath: str
artworkBaseURL: str
uniqueId: str
ignore: bool
def getArtworkPath(self):
unglobbed = os.path.expanduser(self.artworkFile... | 19.34375 | 61 | 0.621971 | from dataclasses import dataclass
import os
@dataclass
class Track:
title: str
artist: str
album: str
length: str
artwork: str
artworkFilePath: str
artworkBaseURL: str
uniqueId: str
ignore: bool
def getArtworkPath(self):
unglobbed = os.path.expanduser(self.artworkFile... | true | true |
f75e11209704b4c1ca00d10b546afdd97cf2b6e8 | 1,618 | py | Python | tests/test_scan.py | eruvanos/dynafile | 207425b073a963b01c677b697e74842b429c004a | [
"MIT"
] | null | null | null | tests/test_scan.py | eruvanos/dynafile | 207425b073a963b01c677b697e74842b429c004a | [
"MIT"
] | null | null | null | tests/test_scan.py | eruvanos/dynafile | 207425b073a963b01c677b697e74842b429c004a | [
"MIT"
] | null | null | null | from _operator import itemgetter
from dynafile import Dynafile
def test_scan_all_items(tmp_path):
db = Dynafile(tmp_path / "db")
aa = {
"PK": "1",
"SK": "aa",
}
ab = {
"PK": "1",
"SK": "ab",
}
ac = {
"PK": "1",
"SK": "ac",
}
ba = {
... | 17.212766 | 90 | 0.434487 | from _operator import itemgetter
from dynafile import Dynafile
def test_scan_all_items(tmp_path):
db = Dynafile(tmp_path / "db")
aa = {
"PK": "1",
"SK": "aa",
}
ab = {
"PK": "1",
"SK": "ab",
}
ac = {
"PK": "1",
"SK": "ac",
}
ba = {
... | true | true |
f75e11a54d351b43109193ec0e6a4249f74c7f50 | 2,331 | py | Python | observations/r/michelson.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | observations/r/michelson.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | observations/r/michelson.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def michelson(path):
"""Michelson's Determinations of the Velocity of Lig... | 33.3 | 74 | 0.698842 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def michelson(path):
import pandas as pd
path = os.path.expanduser(path)
filename = 'michelso... | true | true |
f75e120d06a9fea5ef3e8e2dd0ab426d97121adc | 7,247 | py | Python | python-watcher-2.0.0/watcher/tests/api/v1/test_goals.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | python-watcher-2.0.0/watcher/tests/api/v1/test_goals.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | python-watcher-2.0.0/watcher/tests/api/v1/test_goals.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # 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 writing, software
# distr... | 38.343915 | 77 | 0.616531 |
from oslo_config import cfg
from oslo_serialization import jsonutils
from six.moves.urllib import parse as urlparse
from watcher.common import utils
from watcher.tests.api import base as api_base
from watcher.tests.objects import utils as obj_utils
class TestListGoal(api_base.FunctionalTest):
def _assert_goal_... | true | true |
f75e124b8191e573e31b7efd4cadfad2116e821d | 41 | py | Python | 25/02/hex.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | null | null | null | 25/02/hex.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | 46 | 2017-06-30T22:19:07.000Z | 2017-07-31T22:51:31.000Z | 25/02/hex.py | pylangstudy/201707 | c1cc72667f1e0b6e8eef4ee85067d7fa4ca500b6 | [
"CC0-1.0"
] | null | null | null | #hex(x)
print(hex(255))
print(hex(-255))
| 10.25 | 16 | 0.634146 | print(hex(255))
print(hex(-255))
| true | true |
f75e141b8f9a857186ec0157edc5f04f9c33ca4e | 1,646 | py | Python | ufile/config.py | NightRain233/ufile-sdk-python | a193ebacf6e6488846cd9fd1580686073136b6c6 | [
"MIT"
] | 18 | 2019-04-09T03:45:40.000Z | 2021-11-27T16:41:33.000Z | ufile/config.py | NightRain233/ufile-sdk-python | a193ebacf6e6488846cd9fd1580686073136b6c6 | [
"MIT"
] | 9 | 2019-10-22T02:18:05.000Z | 2021-06-29T10:54:55.000Z | ufile/config.py | NightRain233/ufile-sdk-python | a193ebacf6e6488846cd9fd1580686073136b6c6 | [
"MIT"
] | 20 | 2019-05-29T05:53:50.000Z | 2021-11-27T16:43:02.000Z | # -*- coding: utf-8 -*-
import platform
from . import __version__
_sys_info = '{0}: {1}'.format(platform.system(), platform.machine())
_python_ver = platform.python_version()
USER_AGENT = 'UCloud UFile Python SDK {0} ({1} : Python/{2})'.format(__version__, _sys_info, _python_ver)
UCLOUD_PROXY_SUFFIX = '.cn-bj.ufile... | 28.37931 | 122 | 0.68955 |
import platform
from . import __version__
_sys_info = '{0}: {1}'.format(platform.system(), platform.machine())
_python_ver = platform.python_version()
USER_AGENT = 'UCloud UFile Python SDK {0} ({1} : Python/{2})'.format(__version__, _sys_info, _python_ver)
UCLOUD_PROXY_SUFFIX = '.cn-bj.ufileos.com'
UCLOUD_DOWNLOAD_... | true | true |
f75e14bb9ad7a6c8233aa79eed96ab94da69964f | 6,687 | py | Python | smarts/core/utils/math.py | amsks/SMARTS | 341ab5974bb77c90953536349e478d9b79994a64 | [
"MIT"
] | null | null | null | smarts/core/utils/math.py | amsks/SMARTS | 341ab5974bb77c90953536349e478d9b79994a64 | [
"MIT"
] | null | null | null | smarts/core/utils/math.py | amsks/SMARTS | 341ab5974bb77c90953536349e478d9b79994a64 | [
"MIT"
] | 1 | 2021-04-18T00:17:05.000Z | 2021-04-18T00:17:05.000Z | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | 28.096639 | 109 | 0.623598 | import math
import numpy as np
def batches(list_, n):
for i in range(0, len(list_), n):
yield list_[i : i + n]
def yaw_from_quaternion(quaternion) -> float:
assert len(quaternion) == 4, f"len({quaternion}) != 4"
siny_cosp = 2 * (quaternion[0] * quaternion[1] + quaternion[3] * quaternion[2])
... | true | true |
f75e14c3527a8e7f6503be088b08878dd8155df6 | 3,033 | py | Python | devscripts/readme_for_cdn.py | sheerluck/ytdl-patched | 3242cc80a420fc1c4433dba680c84b1b5820ec68 | [
"Unlicense"
] | 80 | 2021-05-25T11:33:49.000Z | 2022-03-29T20:36:53.000Z | devscripts/readme_for_cdn.py | sheerluck/ytdl-patched | 3242cc80a420fc1c4433dba680c84b1b5820ec68 | [
"Unlicense"
] | 22 | 2021-05-08T13:44:12.000Z | 2022-03-30T01:27:23.000Z | devscripts/readme_for_cdn.py | sheerluck/ytdl-patched | 3242cc80a420fc1c4433dba680c84b1b5820ec68 | [
"Unlicense"
] | 22 | 2021-05-07T05:01:27.000Z | 2022-03-26T19:10:54.000Z | from __future__ import unicode_literals
import re
import sys
import subprocess
import os
infile, outfile = sys.argv[1:]
# usage: python3 devscripts/readme_for_cdn.py ../README.md to_be_converted.md
# git rev-parse --short master
git_commit = ''
for cwd in [
os.path.join(os.getcwd(), os.path.abspath(__file__), '... | 30.94898 | 153 | 0.672931 | from __future__ import unicode_literals
import re
import sys
import subprocess
import os
infile, outfile = sys.argv[1:]
git_commit = ''
for cwd in [
os.path.join(os.getcwd(), os.path.abspath(__file__), '../public'),
os.path.join(os.getcwd(), os.path.abspath(__file__), 'public'),
os.path.dirname(os.path.... | true | true |
f75e14f564c83855d2882f2d21fbc27e62a98316 | 3,339 | py | Python | conanfile.py | jgsogo/conan-spdlog_setup | 359e6978fbd698a13c17b46e44bdbae107fa7f3f | [
"MIT"
] | null | null | null | conanfile.py | jgsogo/conan-spdlog_setup | 359e6978fbd698a13c17b46e44bdbae107fa7f3f | [
"MIT"
] | null | null | null | conanfile.py | jgsogo/conan-spdlog_setup | 359e6978fbd698a13c17b46e44bdbae107fa7f3f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import os
import shutil
class SPDLogSetupConan(ConanFile):
name = "spdlog_setup"
version = "master"
url = "https://github.com/bincrafters/conan-spdlog_setup"
description = "spdlog setup initialization via file co... | 35.147368 | 139 | 0.679545 |
from conans import ConanFile, CMake, tools
import os
import shutil
class SPDLogSetupConan(ConanFile):
name = "spdlog_setup"
version = "master"
url = "https://github.com/bincrafters/conan-spdlog_setup"
description = "spdlog setup initialization via file configuration for convenience."
license... | true | true |
f75e153b405b49ecd3efc1535ae75b36ea99ce28 | 647 | py | Python | msgboard/migrations/0001_initial.py | nadavspinco/beyond-tutorial | f1baa4b6732e5d95ad3020a593d28d0b03742114 | [
"MIT"
] | null | null | null | msgboard/migrations/0001_initial.py | nadavspinco/beyond-tutorial | f1baa4b6732e5d95ad3020a593d28d0b03742114 | [
"MIT"
] | null | null | null | msgboard/migrations/0001_initial.py | nadavspinco/beyond-tutorial | f1baa4b6732e5d95ad3020a593d28d0b03742114 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-02-24 22:41
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
... | 25.88 | 114 | 0.584235 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(auto_created=True, ... | true | true |
f75e15b8d490575d245f4c043684505daf190bea | 1,531 | py | Python | gdoc/lib/pandocastobject/pandocast/inlinelist.py | tyskdm/gdoc | e7a9f95bdd8dce9374c23e2b5d87e09f3df89c32 | [
"MIT"
] | null | null | null | gdoc/lib/pandocastobject/pandocast/inlinelist.py | tyskdm/gdoc | e7a9f95bdd8dce9374c23e2b5d87e09f3df89c32 | [
"MIT"
] | null | null | null | gdoc/lib/pandocastobject/pandocast/inlinelist.py | tyskdm/gdoc | e7a9f95bdd8dce9374c23e2b5d87e09f3df89c32 | [
"MIT"
] | null | null | null | r"""
Inline class
"""
from .block import Block
class InlineList(Block):
"""
InlineList class of PandocAST Element handler.
"""
def __init__(self, pan_elem, elem_type, type_def, create_element):
""" Constructor
@param pan_elem(Dict)
PandocAST Element
@param elem_typ... | 27.339286 | 78 | 0.549967 |
from .block import Block
class InlineList(Block):
def __init__(self, pan_elem, elem_type, type_def, create_element):
super().__init__(pan_elem, elem_type, type_def)
self.text = ''
if not self.hascontent():
self.children = None
self.text = type_def['alt... | true | true |
f75e161873164b535e8e0b24d66a2b2ba8b5c531 | 1,705 | py | Python | src/apps/climsoft/schemas/stationqualifier_schema.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 3 | 2020-12-01T09:25:18.000Z | 2022-02-14T23:57:34.000Z | src/apps/climsoft/schemas/stationqualifier_schema.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 11 | 2021-12-05T10:09:00.000Z | 2022-02-17T08:11:22.000Z | src/apps/climsoft/schemas/stationqualifier_schema.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 2 | 2021-03-10T19:03:05.000Z | 2021-12-11T08:36:04.000Z | from pydantic import BaseModel, constr
from common_schemas import Response
from typing import List
from apps.climsoft.schemas import station_schema
class CreateStationQualifier(BaseModel):
qualifier: constr(max_length=255)
qualifierBeginDate: constr(max_length=50)
qualifierEndDate: constr(max_length=50)
... | 28.416667 | 57 | 0.697361 | from pydantic import BaseModel, constr
from common_schemas import Response
from typing import List
from apps.climsoft.schemas import station_schema
class CreateStationQualifier(BaseModel):
qualifier: constr(max_length=255)
qualifierBeginDate: constr(max_length=50)
qualifierEndDate: constr(max_length=50)
... | true | true |
f75e17357d72ca60667afeac4376f2d52e2974b4 | 9,427 | py | Python | test/test_sigproc.py | Radio-Camera-Initiative/bifrost | d4891bcc97335fb6e7955314c40631ef9136f556 | [
"BSD-3-Clause"
] | 52 | 2017-01-08T04:49:25.000Z | 2021-12-28T18:49:12.000Z | test/test_sigproc.py | Radio-Camera-Initiative/bifrost | d4891bcc97335fb6e7955314c40631ef9136f556 | [
"BSD-3-Clause"
] | 131 | 2016-12-22T19:08:35.000Z | 2022-03-31T22:55:26.000Z | test/test_sigproc.py | epic-astronomy/bifrost | 9bc7000ce1b42a55b70dff56a2e03253358ba8eb | [
"BSD-3-Clause"
] | 19 | 2017-01-26T20:19:29.000Z | 2022-03-04T15:40:25.000Z | # Copyright (c) 2016, The Bifrost Authors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | 46.210784 | 286 | 0.681129 |
import unittest
import bifrost
from bifrost.sigproc import *
import time
class Test_init(unittest.TestCase):
def setUp(self):
self.myfile = SigprocFile()
self.myfile.open(filename='./data/2chan1bitNoDM.fil',mode='r+b')
self.myfile.read_header()
def test_basic(self):
self.myfile... | true | true |
f75e173dcd9a55d798cc6d42daa4332e92ae6719 | 491 | py | Python | mail_editor/migrations/0005_auto_20200220_1656.py | maykinmedia/maykin-email-templates | 946538cf07e8fbb6df577fe5ea22b970bf54b4a2 | [
"BSD-3-Clause"
] | 4 | 2019-03-11T04:36:05.000Z | 2021-08-13T07:58:53.000Z | mail_editor/migrations/0005_auto_20200220_1656.py | maykinmedia/maykin-email-templates | 946538cf07e8fbb6df577fe5ea22b970bf54b4a2 | [
"BSD-3-Clause"
] | 15 | 2017-03-02T12:16:20.000Z | 2022-01-21T15:03:44.000Z | mail_editor/migrations/0005_auto_20200220_1656.py | maykinmedia/maykin-email-templates | 946538cf07e8fbb6df577fe5ea22b970bf54b4a2 | [
"BSD-3-Clause"
] | 3 | 2019-09-29T05:45:26.000Z | 2020-08-20T03:15:17.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mail_editor', '0004_auto_20170406_1814'),
]
operations = [
migrations.AlterField(
model_name='mailtemplate',
... | 24.55 | 127 | 0.617108 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mail_editor', '0004_auto_20170406_1814'),
]
operations = [
migrations.AlterField(
model_name='mailtemplate',
name='language'... | true | true |
f75e1787ee2246a8691bb50a1fff6c94a952a7ab | 4,355 | py | Python | dsp/dsp.py | maximiliankc/photo-fun | 460f0b00d58c31ff2ed0283c6c4a07b9c481c9f0 | [
"MIT"
] | null | null | null | dsp/dsp.py | maximiliankc/photo-fun | 460f0b00d58c31ff2ed0283c6c4a07b9c481c9f0 | [
"MIT"
] | null | null | null | dsp/dsp.py | maximiliankc/photo-fun | 460f0b00d58c31ff2ed0283c6c4a07b9c481c9f0 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# W = J/sample
## Filtering
def sinc_kernel(cutoff, halflength): # cutoff should be between 0 and 1, TODO window function, low-pass/highpass
n = np.arange(-halflength, halflength + 1)
# get the sinc function:
out = np.sinc(cutoff*n)
# return the norm... | 26.077844 | 112 | 0.552009 | import numpy as np
import matplotlib.pyplot as plt
def sinc_kernel(cutoff, halflength): n = np.arange(-halflength, halflength + 1)
out = np.sinc(cutoff*n)
return out/np.sum(out)
def fir_filt(signal, kernel, centre=0): out = np.convolve(signal, kernel)
return out[centre:centre+signal.shap... | true | true |
f75e1816de6e4884a56f4563110c7c6d99718523 | 25,324 | py | Python | ostap/frames/frames.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | null | null | null | ostap/frames/frames.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | null | null | null | ostap/frames/frames.py | TatianaOvsiannikova/ostap | a005a78b4e2860ac8f4b618e94b4b563b2eddcf1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/frames/frames.py
# Module with decoration of TDataFrame objects for efficient use in python
# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
# @date 2018-06-16
# ================... | 33.900937 | 121 | 0.463434 | __version__ = "$Revision$"
__author__ = "Vanya BELYAEV Ivan.Belyaev@itep.ru"
__date__ = "2011-06-07"
__all__ = (
'DataFrame' , 'report_print' , 'report_print_table' , 'report_as_table' , 'frame_progress' , 'frame_table' , 'frame_project' , )
imp... | true | true |
f75e18803452033a7ff2690bf430fc07bea6d9c3 | 2,604 | py | Python | mtsync/cli.py | chaosmanagement/mtsync | ad4dc83405bae6f59ccf98917773b16df760547b | [
"MIT"
] | 1 | 2021-09-14T15:07:20.000Z | 2021-09-14T15:07:20.000Z | mtsync/cli.py | chaosmanagement/mtsync | ad4dc83405bae6f59ccf98917773b16df760547b | [
"MIT"
] | null | null | null | mtsync/cli.py | chaosmanagement/mtsync | ad4dc83405bae6f59ccf98917773b16df760547b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import asyncio
import json
import logging
import sys
from functools import wraps
from typing import Optional, TextIO
import click
import uvloop
from rich.console import Console
from mtsync.connection import Connection
from mtsync.settings import Settings
from mtsync.synchronizer import Synchroni... | 22.842105 | 85 | 0.663978 | import asyncio
import json
import logging
import sys
from functools import wraps
from typing import Optional, TextIO
import click
import uvloop
from rich.console import Console
from mtsync.connection import Connection
from mtsync.settings import Settings
from mtsync.synchronizer import Synchronizer
def wrap_corouti... | true | true |
f75e1888668b948c4ada902b763b7624e60e8948 | 8,475 | py | Python | tensorflow-large-model-support/tflms-v2/test/manual/kerasload/ktk_resnet50_train_saveweights_h5.py | Phaeton-lang/baselines | 472c248047fbb55b5fa0e620758047b7f0a1d041 | [
"MIT"
] | null | null | null | tensorflow-large-model-support/tflms-v2/test/manual/kerasload/ktk_resnet50_train_saveweights_h5.py | Phaeton-lang/baselines | 472c248047fbb55b5fa0e620758047b7f0a1d041 | [
"MIT"
] | null | null | null | tensorflow-large-model-support/tflms-v2/test/manual/kerasload/ktk_resnet50_train_saveweights_h5.py | Phaeton-lang/baselines | 472c248047fbb55b5fa0e620758047b7f0a1d041 | [
"MIT"
] | null | null | null | # Copyright 2018, 2019. IBM All Rights Reserved.
# 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/li... | 46.565934 | 104 | 0.630206 |
import argparse
import keras
import numpy as np
from keras.callbacks import Callback
from tensorflow_large_model_support import LMS
import ctypes
_cudart = ctypes.CDLL('libcudart.so')
class CudaProfileCallback(Callback):
def __init__(self, profile_epoch, profile_batch_start, profile_batch_end):
self._ep... | true | true |
f75e18e569ef2facbe4e793c560fa6f1f4df86b1 | 124 | py | Python | BLOX/Common/Dialects.py | linearlabstech/blox | 6a5c8a28fcfcb17731be89939284e7ac13a047d7 | [
"Apache-2.0"
] | 17 | 2019-03-31T18:37:35.000Z | 2020-08-17T18:14:40.000Z | BLOX/Common/Dialects.py | linearlabstech/blox | 6a5c8a28fcfcb17731be89939284e7ac13a047d7 | [
"Apache-2.0"
] | null | null | null | BLOX/Common/Dialects.py | linearlabstech/blox | 6a5c8a28fcfcb17731be89939284e7ac13a047d7 | [
"Apache-2.0"
] | 1 | 2019-04-02T07:02:08.000Z | 2019-04-02T07:02:08.000Z |
'''
Eventually we're going to support TF as well
'''
# import torch
# PT = {
# 'MODULE':nn.Module
# }
# TF = {
# } | 8.266667 | 44 | 0.524194 | true | true | |
f75e194f5db118fd6531a85df606537ec5b81835 | 1,303 | py | Python | project/augmentation/__init__.py | zhengzangw/pytorch-template | 34d2d18c349188e59f2958a53fb76697b80db58a | [
"MIT"
] | null | null | null | project/augmentation/__init__.py | zhengzangw/pytorch-template | 34d2d18c349188e59f2958a53fb76697b80db58a | [
"MIT"
] | null | null | null | project/augmentation/__init__.py | zhengzangw/pytorch-template | 34d2d18c349188e59f2958a53fb76697b80db58a | [
"MIT"
] | null | null | null | from torchvision import transforms
DICT = {
"mnist": transforms.Compose(
[transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]
),
"cifar10_train": transforms.Compose(
[
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
... | 30.302326 | 88 | 0.562548 | from torchvision import transforms
DICT = {
"mnist": transforms.Compose(
[transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]
),
"cifar10_train": transforms.Compose(
[
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
... | true | true |
f75e195f1ba1851ad2f4768c2dc1bf1b98f7adcd | 403 | py | Python | PyTealChecker/PyTealChecker/asgi.py | jakobrichert/PyTeal-Parser | e12bc6f3dcc76609d847df9a62bb942aa7223899 | [
"MIT"
] | null | null | null | PyTealChecker/PyTealChecker/asgi.py | jakobrichert/PyTeal-Parser | e12bc6f3dcc76609d847df9a62bb942aa7223899 | [
"MIT"
] | 4 | 2022-01-31T12:41:06.000Z | 2022-01-31T14:28:26.000Z | PyTealChecker/PyTealChecker/asgi.py | jakobrichert/PyTeal-Checker | e12bc6f3dcc76609d847df9a62bb942aa7223899 | [
"MIT"
] | null | null | null | """
ASGI config for PyTealChecker project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'PyTealChecker.settings')
application = get_asgi_application()
| true | true |
f75e196dc9c9e6c8ac8c8885c5f7a02c3e317e7c | 8,319 | py | Python | account/utils.py | coseasonruby/Gluu-Ecommerce-djagno-project | d196309bbd76571ee7793bd3de4342eb81f789e1 | [
"MIT"
] | null | null | null | account/utils.py | coseasonruby/Gluu-Ecommerce-djagno-project | d196309bbd76571ee7793bd3de4342eb81f789e1 | [
"MIT"
] | null | null | null | account/utils.py | coseasonruby/Gluu-Ecommerce-djagno-project | d196309bbd76571ee7793bd3de4342eb81f789e1 | [
"MIT"
] | null | null | null | import logging
import datetime
from calendar import month_name
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.mail import get_connection
from gluu_ecommerce.utils import send_mail, generate_sha1
from account.connectors.idp_interface import email_exists
fro... | 29.92446 | 108 | 0.65128 | import logging
import datetime
from calendar import month_name
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.mail import get_connection
from gluu_ecommerce.utils import send_mail, generate_sha1
from account.connectors.idp_interface import email_exists
fro... | true | true |
f75e1a30d720a9461f2f2e27ff1935112d488499 | 2,568 | py | Python | diffeqtorch/install.py | michaeldeistler/diffeqtorch | e06cb276ceb4dc6b2b1684e480da08a17cc59c26 | [
"MIT"
] | 9 | 2021-01-13T07:03:25.000Z | 2021-09-06T16:51:30.000Z | diffeqtorch/install.py | michaeldeistler/diffeqtorch | e06cb276ceb4dc6b2b1684e480da08a17cc59c26 | [
"MIT"
] | 2 | 2021-02-25T17:27:12.000Z | 2021-12-08T07:29:32.000Z | diffeqtorch/install.py | michaeldeistler/diffeqtorch | e06cb276ceb4dc6b2b1684e480da08a17cc59c26 | [
"MIT"
] | 2 | 2021-02-25T14:40:42.000Z | 2021-09-06T16:51:35.000Z | import os
import subprocess
from pathlib import Path
from warnings import warn
from .logging import get_logger
JULIA_PROJECT = str(Path(__file__).parent / "julia")
os.environ["JULIA_PROJECT"] = JULIA_PROJECT
log = get_logger("diffeqtorch_install")
def install_and_test(pyjulia=True, julia_deps=True, julia_sysimage=... | 26.75 | 89 | 0.649533 | import os
import subprocess
from pathlib import Path
from warnings import warn
from .logging import get_logger
JULIA_PROJECT = str(Path(__file__).parent / "julia")
os.environ["JULIA_PROJECT"] = JULIA_PROJECT
log = get_logger("diffeqtorch_install")
def install_and_test(pyjulia=True, julia_deps=True, julia_sysimage=... | true | true |
f75e1aaef1e7e8393b26cecb7bb95b6203f68346 | 69,392 | py | Python | src/sage/dynamics/interval_exchanges/labelled.py | robertwb/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/dynamics/interval_exchanges/labelled.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/dynamics/interval_exchanges/labelled.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | r"""
Labelled permutations
A labelled (generalized) permutation is better suited to study the
dynamic of a translation surface than a reduced one (see the module
:mod:`sage.dynamics.interval_exchanges.reduced`). The latter is more
adapted to the study of strata. This kind of permutation was
introduced by Yoccoz [Yoc05... | 28.404421 | 101 | 0.513258 | from __future__ import print_function
from __future__ import absolute_import
from sage.structure.sage_object import SageObject
from sage.misc.lazy_attribute import lazy_attribute
from copy import copy
from sage.combinat.words.alphabet import Alphabet
from sage.combinat.words.morphism import WordMorphism
from sage.m... | true | true |
f75e1afa2f582ef72566a9f1236eb47e92500b9e | 515 | py | Python | geoq/training/admin.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 471 | 2015-01-05T15:16:26.000Z | 2022-03-28T05:06:11.000Z | geoq/training/admin.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 109 | 2015-01-06T20:00:58.000Z | 2022-03-11T23:17:53.000Z | geoq/training/admin.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 100 | 2015-01-05T15:16:39.000Z | 2021-12-01T12:13:13.000Z | # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from reversion.admin import VersionAdmin
from django.contrib.gis import admin
from .models import *
class Objec... | 32.1875 | 104 | 0.757282 |
from reversion.admin import VersionAdmin
from django.contrib.gis import admin
from .models import *
class ObjectAdmin(VersionAdmin,):
pass
@admin.register(Training)
class TrainingAdmin(ObjectAdmin):
list_display = ('name', 'category', 'private', 'primary_contact')
list_filter = ('category',)
| true | true |
f75e1b06b05dd71f3ddbe96b84db4e22e357c2e0 | 13,444 | py | Python | apiserver/views/agent_download.py | MadDonkey/DongTai-openapi | 40f5b218dcc2fee70e514ada20536ed3f2006404 | [
"Apache-2.0"
] | null | null | null | apiserver/views/agent_download.py | MadDonkey/DongTai-openapi | 40f5b218dcc2fee70e514ada20536ed3f2006404 | [
"Apache-2.0"
] | null | null | null | apiserver/views/agent_download.py | MadDonkey/DongTai-openapi | 40f5b218dcc2fee70e514ada20536ed3f2006404 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:owefsad
# datetime:2021/1/14 下午7:17
# software: PyCharm
# project: lingzhi-agent-server
import json
import os, re
import uuid, logging
from django.http import FileResponse
from dongtai.endpoint import OpenApiEndPoint, R
from drf_spectacular.utils import extend_sche... | 41.11315 | 446 | 0.607706 | import json
import os, re
import uuid, logging
from django.http import FileResponse
from dongtai.endpoint import OpenApiEndPoint, R
from drf_spectacular.utils import extend_schema, OpenApiParameter, OpenApiExample
from rest_framework.authtoken.models import Token
from django.utils.translation import gettext_lazy as _
... | true | true |
f75e1b8afa4034e66e378525514fa42edb435ac0 | 614 | py | Python | PrevisaoTempo/Weather.py | MorenoVinicius/Python | a2260e1dcd3af3630bbbf2a562d433cfd430e249 | [
"MIT"
] | 1 | 2022-03-19T01:09:19.000Z | 2022-03-19T01:09:19.000Z | PrevisaoTempo/Weather.py | MorenoVinicius/Python | a2260e1dcd3af3630bbbf2a562d433cfd430e249 | [
"MIT"
] | null | null | null | PrevisaoTempo/Weather.py | MorenoVinicius/Python | a2260e1dcd3af3630bbbf2a562d433cfd430e249 | [
"MIT"
] | null | null | null | import requests # Importando biblioteca
API_KEY = "6e401fdf2b11f18db16cd6c71a777534" # Minha chave da API
cidade = input('Digite o nome da cidade : ' ) # Input para pesquisar a temperatura na cidade
link = f"https://api.openweathermap.org/data/2.5/weather?q={cidade}&appid={API_KEY}&lang=pt_br" #Link da API
req = requ... | 38.375 | 108 | 0.750814 | import requests
API_KEY = "6e401fdf2b11f18db16cd6c71a777534" cidade = input('Digite o nome da cidade : ' ) link = f"https://api.openweathermap.org/data/2.5/weather?q={cidade}&appid={API_KEY}&lang=pt_br"
req = requests.get(link)
req_dic= req.json()
descricao = req_dic['weather'][0]['description']
temperatura = req_... | true | true |
f75e1bbd91fd329bea50425c828ffbf5b2ab1b32 | 120 | py | Python | desafio_certo.py | franciol/Servidor_de_desafios | 3ce3de561af5ce5182a3d0f5db0a7dfd3b51a8fc | [
"MIT"
] | null | null | null | desafio_certo.py | franciol/Servidor_de_desafios | 3ce3de561af5ce5182a3d0f5db0a7dfd3b51a8fc | [
"MIT"
] | null | null | null | desafio_certo.py | franciol/Servidor_de_desafios | 3ce3de561af5ce5182a3d0f5db0a7dfd3b51a8fc | [
"MIT"
] | null | null | null | """Arquivo a ser enviado ao sistema"""
def desafio1(number):
"""Função que retorna o valor entrado"""
return 0
| 20 | 44 | 0.666667 |
def desafio1(number):
return 0
| true | true |
f75e1bcb578148254ad16a785897b19481758307 | 2,519 | py | Python | bots/stocks/government/lastcontracts.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 255 | 2022-03-29T16:43:51.000Z | 2022-03-31T23:57:08.000Z | bots/stocks/government/lastcontracts.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 14 | 2022-03-29T14:20:33.000Z | 2022-03-31T23:39:20.000Z | bots/stocks/government/lastcontracts.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 24 | 2022-03-29T15:28:56.000Z | 2022-03-31T23:54:15.000Z | import logging
import disnake
import pandas as pd
from bots import imps
from openbb_terminal.decorators import log_start_end
from openbb_terminal.stocks.government import quiverquant_model
logger = logging.getLogger(__name__)
@log_start_end(log=logger)
def lastcontracts_command(past_transactions_days: int = 2, num... | 29.988095 | 82 | 0.62763 | import logging
import disnake
import pandas as pd
from bots import imps
from openbb_terminal.decorators import log_start_end
from openbb_terminal.stocks.government import quiverquant_model
logger = logging.getLogger(__name__)
@log_start_end(log=logger)
def lastcontracts_command(past_transactions_days: int = 2, num... | true | true |
f75e1bfafb5a4d722da09c9e71dc02065a621ec2 | 1,584 | py | Python | websites/views.py | wanguinjoka/Tech-Olympia | 35b070c5011173f16bf4725e6200d988a27bc10f | [
"MIT"
] | null | null | null | websites/views.py | wanguinjoka/Tech-Olympia | 35b070c5011173f16bf4725e6200d988a27bc10f | [
"MIT"
] | null | null | null | websites/views.py | wanguinjoka/Tech-Olympia | 35b070c5011173f16bf4725e6200d988a27bc10f | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic import ListView, DetailView,CreateView,UpdateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from .models import Site
# Create your views here.
def welcome(request):
context = {
'sites': Site.object... | 31.058824 | 87 | 0.692551 | from django.shortcuts import render
from django.views.generic import ListView, DetailView,CreateView,UpdateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from .models import Site
def welcome(request):
context = {
'sites': Site.objects.all()
}
return r... | true | true |
f75e1c5e6b37b01c905ff0fd48f3b493f30d6215 | 6,187 | py | Python | salt/modules/openscap.py | nadvornik/salt-1 | 6837044f5a207cf39f3064428b0ed276226a5e39 | [
"Apache-2.0"
] | null | null | null | salt/modules/openscap.py | nadvornik/salt-1 | 6837044f5a207cf39f3064428b0ed276226a5e39 | [
"Apache-2.0"
] | null | null | null | salt/modules/openscap.py | nadvornik/salt-1 | 6837044f5a207cf39f3064428b0ed276226a5e39 | [
"Apache-2.0"
] | null | null | null | """
Module for OpenSCAP Management
"""
import os.path
import shlex
import shutil
import tempfile
from subprocess import PIPE, Popen
ArgumentParser = object
try:
import argparse # pylint: disable=minimum-python-version
ArgumentParser = argparse.ArgumentParser
HAS_ARGPARSE = True
except ImportError: #... | 28.776744 | 101 | 0.642315 |
import os.path
import shlex
import shutil
import tempfile
from subprocess import PIPE, Popen
ArgumentParser = object
try:
import argparse
ArgumentParser = argparse.ArgumentParser
HAS_ARGPARSE = True
except ImportError: HAS_ARGPARSE = False
_XCCDF_MAP = {
"eval": {
"parser_arguments"... | true | true |
f75e1d4cfe334c9b230f31a22dbb5e6bc1e6a354 | 1,145 | py | Python | contrib/filter-lcov.py | trungnq1510/bitcoin | 4702a08358f9996f2a40cb5cba03c9177d4d991f | [
"MIT"
] | null | null | null | contrib/filter-lcov.py | trungnq1510/bitcoin | 4702a08358f9996f2a40cb5cba03c9177d4d991f | [
"MIT"
] | null | null | null | contrib/filter-lcov.py | trungnq1510/bitcoin | 4702a08358f9996f2a40cb5cba03c9177d4d991f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitnamicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import argparse
parser = argparse.ArgumentParser(description='Remove the coverage data from a tracef... | 39.482759 | 125 | 0.680349 |
import argparse
parser = argparse.ArgumentParser(description='Remove the coverage data from a tracefile for all files matching the pattern.')
parser.add_argument('--pattern', '-p', action='append', help='the pattern of files to remove', required=True)
parser.add_argument('tracefile', help='the tracefile to remove the... | true | true |
f75e1dfae558fa366d15fa19e89d353003e728b3 | 2,166 | py | Python | examples/MMPT/scripts/video_feature_extractor/shard_feature.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 16,259 | 2018-05-02T02:31:30.000Z | 2022-03-31T21:50:23.000Z | examples/MMPT/scripts/video_feature_extractor/shard_feature.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 3,863 | 2018-05-02T13:42:39.000Z | 2022-03-31T19:03:32.000Z | examples/MMPT/scripts/video_feature_extractor/shard_feature.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"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 numpy as np
import os
import pickle
from mmpt.utils import ShardedTensor
class Shard(object):
def __init__(
self,
... | 33.323077 | 97 | 0.578486 | import numpy as np
import os
import pickle
from mmpt.utils import ShardedTensor
class Shard(object):
def __init__(
self,
vfeat_dir,
tfeat_dir,
target_dir,
file_paths,
shard_size=4096
):
self.vfeat_dir = vfeat_dir
self.tfeat_dir = tfeat_dir
... | true | true |
f75e1e4d5356b537d875ebb276b2e4dbf0a29cee | 8,745 | py | Python | lib/psu_example/psu_exampleImpl.py | briehl/psu_example | b1103a64f2f530aab940c9ee3d2deb596e04ce2e | [
"MIT"
] | null | null | null | lib/psu_example/psu_exampleImpl.py | briehl/psu_example | b1103a64f2f530aab940c9ee3d2deb596e04ce2e | [
"MIT"
] | null | null | null | lib/psu_example/psu_exampleImpl.py | briehl/psu_example | b1103a64f2f530aab940c9ee3d2deb596e04ce2e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#BEGIN_HEADER
# The header block is where all import statments should live
import os
from Bio import SeqIO
from pprint import pprint, pformat
from AssemblyUtil.AssemblyUtilClient import AssemblyUtil
from KBaseReport.KBaseReportClient import KBaseReport
#END_HEADER
class psu_example:
'''
... | 46.764706 | 109 | 0.630532 | import os
from Bio import SeqIO
from pprint import pprint, pformat
from AssemblyUtil.AssemblyUtilClient import AssemblyUtil
from KBaseReport.KBaseReportClient import KBaseReport
class psu_example:
VERSION = "0.0.1"
GIT_URL = ""
GIT_COMMIT_HASH = ""
# be found... | true | true |
f75e1e987d9f182ed96fa5d1a87db15f1d90fda6 | 1,463 | py | Python | randomised_selection.py | neerajp99/algorithms | 1d6885d2a895821ac511fa8a46913d34db2511ca | [
"MIT"
] | 1 | 2021-06-17T07:59:42.000Z | 2021-06-17T07:59:42.000Z | randomised_selection.py | neerajp99/algorithms | 1d6885d2a895821ac511fa8a46913d34db2511ca | [
"MIT"
] | null | null | null | randomised_selection.py | neerajp99/algorithms | 1d6885d2a895821ac511fa8a46913d34db2511ca | [
"MIT"
] | 1 | 2022-01-13T08:42:31.000Z | 2022-01-13T08:42:31.000Z | # Implementation of Randomised Selection
"""
Naive Approach
---------
Parameters
---------
An arry with n distinct numbers
---------
Returns
---------
i(th) order statistic, i.e: i(th) smallest element of the input array
---------
Time Complexity
---------
O(n.log... | 26.6 | 141 | 0.601504 |
import random
def randomised_selection(unsorted_array, length_of_array, i_order_statistic):
if length_of_array == 1:
return unsorted_array
else:
pivot_range = random.randrange(length_of_array)
pivot = unsorted_array[pivot_range]
pivot_left = []
pivot_right = []... | true | true |
f75e1f2468e305851a55b7b80da1f1517ec9bdf0 | 3,248 | py | Python | longclaw/stats/wagtail_hooks.py | YokoTheSlayer/longclaw | 83801feb24ca6f0dfe0fb7a2ef2e9614e5b75611 | [
"MIT"
] | null | null | null | longclaw/stats/wagtail_hooks.py | YokoTheSlayer/longclaw | 83801feb24ca6f0dfe0fb7a2ef2e9614e5b75611 | [
"MIT"
] | null | null | null | longclaw/stats/wagtail_hooks.py | YokoTheSlayer/longclaw | 83801feb24ca6f0dfe0fb7a2ef2e9614e5b75611 | [
"MIT"
] | null | null | null | import datetime
from wagtail.core import hooks
from wagtail.admin.site_summary import SummaryItem
from longclaw.orders.models import Order
from longclaw.stats import stats
from longclaw.configuration.models import Configuration
from longclaw.utils import ProductVariant, maybe_get_product_model
#from longclaw.utils impo... | 32.808081 | 85 | 0.624076 | import datetime
from wagtail.core import hooks
from wagtail.admin.site_summary import SummaryItem
from longclaw.orders.models import Order
from longclaw.stats import stats
from longclaw.configuration.models import Configuration
from longclaw.utils import ProductVariant, maybe_get_product_model
class LongclawSummaryIte... | true | true |
f75e1f7a1291132f6d021c90c6fe1b4d8dc54aa1 | 19,694 | py | Python | swift/common/wsgi.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | null | null | null | swift/common/wsgi.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | null | null | null | swift/common/wsgi.py | aristanetworks/swift | 9fe774840e75cc54f2e0302e1e4501807fdb8b3c | [
"Apache-2.0"
] | 1 | 2020-06-05T08:07:09.000Z | 2020-06-05T08:07:09.000Z | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | 37.873077 | 79 | 0.644409 |
"""WSGI tools for use with swift."""
import errno
import os
import signal
import time
import mimetools
from swift import gettext_ as _
from itertools import chain
from StringIO import StringIO
import eventlet
import eventlet.debug
from eventlet import greenio, GreenPool, sleep, wsgi, listen
from paste.deploy import ... | false | true |
f75e20eba09cf13eba990abb4ec4a0626906992f | 39 | py | Python | class2/my_func.py | chaojareon/py_ans_ecourse | 56a6f78e9d7ee62c2d4f003a9e77759851ef4a5c | [
"Apache-2.0"
] | null | null | null | class2/my_func.py | chaojareon/py_ans_ecourse | 56a6f78e9d7ee62c2d4f003a9e77759851ef4a5c | [
"Apache-2.0"
] | null | null | null | class2/my_func.py | chaojareon/py_ans_ecourse | 56a6f78e9d7ee62c2d4f003a9e77759851ef4a5c | [
"Apache-2.0"
] | null | null | null |
def print_hello():
print "Hello"
| 7.8 | 18 | 0.615385 |
def print_hello():
print "Hello"
| false | true |
f75e20fd2ed9cc7bfcbffb794f8c43c97726083a | 1,071 | py | Python | portal/blog/migrations/0002_category_post.py | vatsamail/dualdb | c7a5737faed7a37263198f5c9363d1e1e73f0b58 | [
"MIT"
] | null | null | null | portal/blog/migrations/0002_category_post.py | vatsamail/dualdb | c7a5737faed7a37263198f5c9363d1e1e73f0b58 | [
"MIT"
] | 4 | 2021-03-19T08:42:08.000Z | 2022-02-10T11:17:09.000Z | portal/blog/migrations/0002_category_post.py | vatsamail/dualdb | c7a5737faed7a37263198f5c9363d1e1e73f0b58 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-02-22 21:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', m... | 33.46875 | 114 | 0.560224 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=Tr... | true | true |
f75e21f475e602cb2f9f28d3fd3c2f9feac85980 | 29,691 | py | Python | ForgeGit/forgegit/model/git_repo.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | 1 | 2019-03-17T04:16:15.000Z | 2019-03-17T04:16:15.000Z | ForgeGit/forgegit/model/git_repo.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | ForgeGit/forgegit/model/git_repo.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"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 (t... | 37.206767 | 144 | 0.548348 |
import os
import shutil
import string
import logging
import tempfile
from datetime import datetime
from contextlib import contextmanager
from time import time
import tg
import git
import gitdb
from pylons import tmpl_context as c
from pymongo.errors import DuplicateKeyError
from paste.deploy.converters import asbool
... | false | true |
f75e22d945eb2f7a84597962bba34f13e30edfb1 | 951 | py | Python | Python/Automate the Boring Stuff with Python/atbs_ch8_input_validation.py | SitramSoft/programming_practice | 5c4131582634b5dc5a586be891bf645ab7dc5f9a | [
"MIT"
] | null | null | null | Python/Automate the Boring Stuff with Python/atbs_ch8_input_validation.py | SitramSoft/programming_practice | 5c4131582634b5dc5a586be891bf645ab7dc5f9a | [
"MIT"
] | null | null | null | Python/Automate the Boring Stuff with Python/atbs_ch8_input_validation.py | SitramSoft/programming_practice | 5c4131582634b5dc5a586be891bf645ab7dc5f9a | [
"MIT"
] | null | null | null | # File containing exercises for chapter 8 of the Automate The Borring Stuff book - https://automatetheboringstuff.com/2e/chapter8/
# Uses library PyInputPlus -> pip install pyinputplus
import pyinputplus as pyip
def addsUpToTen(numbers):
numbersList = list(numbers)
for i, digit in enumerate(numbersList):
... | 35.222222 | 130 | 0.733964 | import pyinputplus as pyip
def addsUpToTen(numbers):
numbersList = list(numbers)
for i, digit in enumerate(numbersList):
numbersList[i] = int(digit)
if sum(numbersList) != 10:
raise Exception('The digits must add up to 10, not %s.' %(sum(numbersList)))
return int(numbers)
response ... | true | true |
f75e244db251947164caf997fe456ebb44d223d9 | 1,320 | py | Python | ezex/util.py | SimonRamstedt/ezex | 4c7fb01a224de8afc07183bcbbcc999ec8711f56 | [
"MIT"
] | 1 | 2016-04-25T14:18:13.000Z | 2016-04-25T14:18:13.000Z | ezex/util.py | SimonRamstedt/ezex | 4c7fb01a224de8afc07183bcbbcc999ec8711f56 | [
"MIT"
] | null | null | null | ezex/util.py | SimonRamstedt/ezex | 4c7fb01a224de8afc07183bcbbcc999ec8711f56 | [
"MIT"
] | null | null | null | import os
import shutil
import stat
def copy(src, dst, symlinks = False, ignore = None):
ign = shutil.ignore_patterns(ignore)
copytree(src,dst,symlinks,ign)
def copytree(src, dst, symlinks = False, ignore = None):
if not os.path.exists(dst):
os.makedirs(dst)
shutil.copystat(src, dst)
lst = os.listdir... | 25.384615 | 74 | 0.599242 | import os
import shutil
import stat
def copy(src, dst, symlinks = False, ignore = None):
ign = shutil.ignore_patterns(ignore)
copytree(src,dst,symlinks,ign)
def copytree(src, dst, symlinks = False, ignore = None):
if not os.path.exists(dst):
os.makedirs(dst)
shutil.copystat(src, dst)
lst = os.listdir... | true | true |
f75e246c4258d414dd2583e861797923060c2190 | 13,712 | py | Python | src/CLSID Browser.py | Randymations/CLSID-Browser | af7de48f49e3da54d1f2694339d49c1194eecc4c | [
"MIT"
] | 1 | 2021-06-16T13:05:10.000Z | 2021-06-16T13:05:10.000Z | src/CLSID Browser.py | Randymations/CLSID-Browser | af7de48f49e3da54d1f2694339d49c1194eecc4c | [
"MIT"
] | null | null | null | src/CLSID Browser.py | Randymations/CLSID-Browser | af7de48f49e3da54d1f2694339d49c1194eecc4c | [
"MIT"
] | null | null | null | import os
CLSIDs = {
'3D Objects (folder)':'{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}',
'Add Network Location':'{D4480A50-BA28-11d1-8E75-00C04FA31A86}',
'Administrative Tools':'{D20EA4E1-3957-11d2-A40B-0C5020524153}',
'Applications':'{4234d49b-0245-4df3-b780-3893943456e1}',
'AutoPlay':'{9C60DE1E-E5FC-40f4-A487-460... | 66.563107 | 139 | 0.738477 | import os
CLSIDs = {
'3D Objects (folder)':'{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}',
'Add Network Location':'{D4480A50-BA28-11d1-8E75-00C04FA31A86}',
'Administrative Tools':'{D20EA4E1-3957-11d2-A40B-0C5020524153}',
'Applications':'{4234d49b-0245-4df3-b780-3893943456e1}',
'AutoPlay':'{9C60DE1E-E5FC-40f4-A487-460... | true | true |
f75e2559b7deb7770bd049c695134772386fe7bb | 49 | py | Python | notebooks/_solutions/04-gis-python-vectors8.py | florisvdh/course_gis_scripting | 2bb96e7f44832fdd810bd05ed5a4d551fd795502 | [
"BSD-3-Clause"
] | 8 | 2017-05-12T08:36:45.000Z | 2020-12-23T08:14:41.000Z | notebooks/_solutions/04-gis-python-vectors8.py | florisvdh/course_gis_scripting | 2bb96e7f44832fdd810bd05ed5a4d551fd795502 | [
"BSD-3-Clause"
] | 5 | 2017-05-04T07:40:41.000Z | 2018-05-15T08:03:29.000Z | notebooks/_solutions/04-gis-python-vectors8.py | florisvdh/course_gis_scripting | 2bb96e7f44832fdd810bd05ed5a4d551fd795502 | [
"BSD-3-Clause"
] | 16 | 2017-09-05T23:45:52.000Z | 2022-01-18T20:35:04.000Z | gpd.read_file('../data/EUgrid10.geojson').head(1) | 49 | 49 | 0.734694 | gpd.read_file('../data/EUgrid10.geojson').head(1) | true | true |
f75e2559c113e06813f7a11362b48d3a83a808c5 | 16,365 | py | Python | py/desidatamodel/test/test_stub.py | schlafly/desidatamodel | a91880fb4c3ebebd6e0cbcba8ada30b56c37c874 | [
"BSD-3-Clause"
] | null | null | null | py/desidatamodel/test/test_stub.py | schlafly/desidatamodel | a91880fb4c3ebebd6e0cbcba8ada30b56c37c874 | [
"BSD-3-Clause"
] | null | null | null | py/desidatamodel/test/test_stub.py | schlafly/desidatamodel | a91880fb4c3ebebd6e0cbcba8ada30b56c37c874 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desidatamodel.stub functions
"""
import os
import unittest
from unittest.mock import patch
from pkg_resources import resource_filename
from astropy.io import fits
from collections import OrderedDict
from .datamodeltestcase ... | 34.452632 | 183 | 0.503636 | import os
import unittest
from unittest.mock import patch
from pkg_resources import resource_filename
from astropy.io import fits
from collections import OrderedDict
from .datamodeltestcase import DataModelTestCase
from .. import DataModelError
from ..stub import (Stub, extrakey, file_size, fits_column_format,
... | true | true |
f75e25c68ad1b53aa0d7ea51d92231572abc9439 | 83 | py | Python | keyboards/__init__.py | Shubarin/psybot | 9766af45b03ab5fb7e53a7c62caee37be4758d68 | [
"BSD-3-Clause"
] | 1 | 2021-05-09T05:10:11.000Z | 2021-05-09T05:10:11.000Z | keyboards/__init__.py | Shubarin/psybot | 9766af45b03ab5fb7e53a7c62caee37be4758d68 | [
"BSD-3-Clause"
] | null | null | null | keyboards/__init__.py | Shubarin/psybot | 9766af45b03ab5fb7e53a7c62caee37be4758d68 | [
"BSD-3-Clause"
] | null | null | null | from .payments import payment_keyboard
from .send_question import question_keyboard | 41.5 | 44 | 0.891566 | from .payments import payment_keyboard
from .send_question import question_keyboard | true | true |
f75e286b4529e830e5e831358edaca380fb885f4 | 1,044 | py | Python | bot/keyboard.py | cyber-chuvash/garohbot | ca5089ec1b27efb147675945ff52e690ca498270 | [
"MIT"
] | 3 | 2021-12-07T19:32:47.000Z | 2021-12-07T19:32:56.000Z | bot/keyboard.py | cyber-chuvash/garohbot | ca5089ec1b27efb147675945ff52e690ca498270 | [
"MIT"
] | null | null | null | bot/keyboard.py | cyber-chuvash/garohbot | ca5089ec1b27efb147675945ff52e690ca498270 | [
"MIT"
] | null | null | null | import json
class KeyboardButton:
def __init__(self, button_type: str, payload: dict):
self.type = button_type
self.payload = payload
def get_vk_repr(self):
kb_d = self.__dict__
kb_d['payload'] = json.dumps(self.payload)
color = kb_d.pop('color', None)
vk_dic... | 25.463415 | 76 | 0.597701 | import json
class KeyboardButton:
def __init__(self, button_type: str, payload: dict):
self.type = button_type
self.payload = payload
def get_vk_repr(self):
kb_d = self.__dict__
kb_d['payload'] = json.dumps(self.payload)
color = kb_d.pop('color', None)
vk_dic... | true | true |
f75e2905a0bf54acaff60357c82c4b102988398f | 211 | py | Python | abbot/main.py | narfman0/abbot | 206ed692299956fbccb457c6e845bc92682ea79f | [
"MIT"
] | null | null | null | abbot/main.py | narfman0/abbot | 206ed692299956fbccb457c6e845bc92682ea79f | [
"MIT"
] | null | null | null | abbot/main.py | narfman0/abbot | 206ed692299956fbccb457c6e845bc92682ea79f | [
"MIT"
] | null | null | null | import arcade
from abbot.ui.gameplay_window import GameplayWindow
def main():
""" Main method """
window = GameplayWindow()
window.setup()
arcade.run()
if __name__ == "__main__":
main()
| 14.066667 | 51 | 0.649289 | import arcade
from abbot.ui.gameplay_window import GameplayWindow
def main():
window = GameplayWindow()
window.setup()
arcade.run()
if __name__ == "__main__":
main()
| true | true |
f75e296fb05452e8e1aacd3aa07aa2a490505db8 | 259 | py | Python | sge/items.py | az13js/gold | d4df53cd9e3219c66e8df8d1f3311e6a0b245add | [
"WTFPL"
] | null | null | null | sge/items.py | az13js/gold | d4df53cd9e3219c66e8df8d1f3311e6a0b245add | [
"WTFPL"
] | null | null | null | sge/items.py | az13js/gold | d4df53cd9e3219c66e8df8d1f3311e6a0b245add | [
"WTFPL"
] | null | null | null | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class SgeItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
| 19.923077 | 53 | 0.710425 |
import scrapy
class SgeItem(scrapy.Item):
pass
| true | true |
f75e298123ac937921399bb2bcfcd369d8f0f39b | 346 | py | Python | exercicio 38.py | pedropenna1/Exercicios-Python | bde8967a31b2395477f346ca1f1b5cb2de666a40 | [
"MIT"
] | null | null | null | exercicio 38.py | pedropenna1/Exercicios-Python | bde8967a31b2395477f346ca1f1b5cb2de666a40 | [
"MIT"
] | null | null | null | exercicio 38.py | pedropenna1/Exercicios-Python | bde8967a31b2395477f346ca1f1b5cb2de666a40 | [
"MIT"
] | null | null | null | num1 = float(input('Digite um número: '))
num2 = float(input('Digite um número: '))
if num1 > num2:
print('O número {:.2f} é maior que o número {:.2f}'.format(num1,num2))
elif num1 < num2:
print('O número {:.2f} é maior que o número {:.2f}'.format(num2,num1))
else:
print('O número {:.2f} é igual ao número {... | 38.444444 | 74 | 0.630058 | num1 = float(input('Digite um número: '))
num2 = float(input('Digite um número: '))
if num1 > num2:
print('O número {:.2f} é maior que o número {:.2f}'.format(num1,num2))
elif num1 < num2:
print('O número {:.2f} é maior que o número {:.2f}'.format(num2,num1))
else:
print('O número {:.2f} é igual ao número {... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.