hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
80e527eafecf513622481ed24659be5b09078b98 | 29 | py | Python | python-lib/automat/__init__.py | soccasys/automat-tests | 9ab4cfbd79e362f49e2a352f1610d2786b8e2985 | [
"BSD-3-Clause"
] | null | null | null | python-lib/automat/__init__.py | soccasys/automat-tests | 9ab4cfbd79e362f49e2a352f1610d2786b8e2985 | [
"BSD-3-Clause"
] | null | null | null | python-lib/automat/__init__.py | soccasys/automat-tests | 9ab4cfbd79e362f49e2a352f1610d2786b8e2985 | [
"BSD-3-Clause"
] | null | null | null | from automat.client import *
| 14.5 | 28 | 0.793103 |
8cfffd0ce80e018c1f55fe577f643b1ff43f7654 | 229 | py | Python | applications/splitThePhoneNumbers.py | silvioedu/HackerRank-Regex-Practice | dc2f2719385626375eb719b38baf6315ff23cad4 | [
"MIT"
] | null | null | null | applications/splitThePhoneNumbers.py | silvioedu/HackerRank-Regex-Practice | dc2f2719385626375eb719b38baf6315ff23cad4 | [
"MIT"
] | null | null | null | applications/splitThePhoneNumbers.py | silvioedu/HackerRank-Regex-Practice | dc2f2719385626375eb719b38baf6315ff23cad4 | [
"MIT"
] | null | null | null | import re
if __name__ == '__main__':
regex = r"\d+"
for _ in range(int(input())):
match = re.findall(regex, input())
print("CountryCode={},LocalAreaCode={},Number={}".format(match[0], match[1], match[2])) | 32.714286 | 95 | 0.58952 |
a45eb10d1cdba0b74551aa0508b1943fddb1578a | 30,414 | py | Python | airflow/sensors/smart_sensor.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | airflow/sensors/smart_sensor.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | airflow/sensors/smart_sensor.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.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... | 40.177015 | 110 | 0.635102 |
6f820b9982903ee83c2d6ec98f30ce9e18207a92 | 60 | py | Python | samt/__init__.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2020-01-16T08:40:00.000Z | 2020-01-16T08:40:00.000Z | samt/__init__.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | null | null | null | samt/__init__.py | Killerhaschen/marvin-telegram-bot | c65e890a00450ed6ed4312d93e259db0c080ef6d | [
"MIT"
] | 1 | 2019-10-16T08:11:51.000Z | 2019-10-16T08:11:51.000Z | from .samt import Bot, Answer, logger
from .helper import *
| 20 | 37 | 0.75 |
0df08b31fff9b1421b7a7673466a6344a9eaa43b | 1,563 | py | Python | telethon/errors/__init__.py | fx2hero/Telethon | 2c9d43d60027a0ae4bd37bb80cd5e1020b703cbc | [
"MIT"
] | 141 | 2018-10-04T10:02:15.000Z | 2022-03-18T08:47:01.000Z | telethon/errors/__init__.py | fx2hero/Telethon | 2c9d43d60027a0ae4bd37bb80cd5e1020b703cbc | [
"MIT"
] | 34 | 2018-10-04T08:28:01.000Z | 2020-11-02T09:36:02.000Z | telethon/errors/__init__.py | fx2hero/Telethon | 2c9d43d60027a0ae4bd37bb80cd5e1020b703cbc | [
"MIT"
] | 110 | 2018-10-04T04:28:11.000Z | 2022-03-22T05:49:02.000Z | """
This module holds all the base and automatically generated errors that the
Telegram API has. See telethon_generator/errors.json for more.
"""
import re
from .common import (
ReadCancelledError, TypeNotFoundError, InvalidChecksumError,
InvalidBufferError, SecurityError, CdnFileTamperedError,
AlreadyInCo... | 33.978261 | 75 | 0.707614 |
62a0b10e83ae58e938283a833f2ed37c407a04fb | 48,330 | py | Python | venv/Lib/site-packages/sklearn/preprocessing/tests/test_encoders.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/preprocessing/tests/test_encoders.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/preprocessing/tests/test_encoders.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import numpy as np
from scipy import sparse
import pytest
from sklearn.exceptions import NotFittedError
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import _convert_container
from skl... | 34.769784 | 89 | 0.578605 |
4952e8e475178894137417b67fc87f8d5367cb6d | 17,264 | py | Python | onpolicy/envs/mpe/environment.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | 5 | 2021-06-15T05:06:10.000Z | 2021-12-01T05:11:49.000Z | onpolicy/envs/mpe/environment.py | ReinholdM/on-policy | 121044954756b5317230e30d47e409802991458b | [
"MIT"
] | null | null | null | onpolicy/envs/mpe/environment.py | ReinholdM/on-policy | 121044954756b5317230e30d47e409802991458b | [
"MIT"
] | null | null | null | import gym
from gym import spaces
from gym.envs.registration import EnvSpec
import numpy as np
from .multi_discrete import MultiDiscrete
# update bounds to center around agent
cam_range = 2
# environment for all agents in the multiagent world
# currently code assumes that no agents will be created/destroyed at runtim... | 40.055684 | 127 | 0.530178 |
768cf41dae9f5ab0c097a8fce414da43030768e4 | 941 | py | Python | main.py | amitport/A2C | b9db1587656679bfadf8c409ceebbb7ac4034a22 | [
"Apache-2.0"
] | 181 | 2018-01-05T18:09:24.000Z | 2022-03-27T06:16:56.000Z | main.py | yo-yrl/A2C | b9db1587656679bfadf8c409ceebbb7ac4034a22 | [
"Apache-2.0"
] | 14 | 2018-02-05T01:03:07.000Z | 2021-03-19T09:32:50.000Z | main.py | yo-yrl/A2C | b9db1587656679bfadf8c409ceebbb7ac4034a22 | [
"Apache-2.0"
] | 49 | 2018-01-12T05:02:59.000Z | 2022-03-05T05:07:18.000Z | import tensorflow as tf
from utils.utils import create_experiment_dirs
from utils.utils import parse_args
from A2C import A2C
def main():
# Parse the JSON arguments
config_args = parse_args()
tf.reset_default_graph()
config = tf.ConfigProto(allow_soft_placement=True,
intr... | 28.515152 | 133 | 0.714134 |
89ffd0bd732422b99ce801096ba364f6454e1c03 | 15,208 | py | Python | acq4/devices/MockClamp/MockClamp.py | campagnola/acq4 | 09699c07d8949950f6df149cf17892aaa3a37402 | [
"MIT"
] | null | null | null | acq4/devices/MockClamp/MockClamp.py | campagnola/acq4 | 09699c07d8949950f6df149cf17892aaa3a37402 | [
"MIT"
] | 3 | 2016-03-29T15:32:27.000Z | 2017-01-13T20:03:50.000Z | acq4/devices/MockClamp/MockClamp.py | campagnola/acq4 | 09699c07d8949950f6df149cf17892aaa3a37402 | [
"MIT"
] | 2 | 2016-08-27T17:22:07.000Z | 2016-10-19T21:51:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, with_statement
import os
import pyqtgraph.multiprocess as mp
from acq4.devices.AxoPatch200 import CancelException
from acq4.devices.DAQGeneric import DAQGeneric, DAQGenericTask, DAQGenericTaskGui
from acq4.devices.PatchClamp import P... | 33.946429 | 139 | 0.598698 |
05709aae01fd4368494d31f610638b5fcc5ddad7 | 603 | py | Python | app/__init__.py | nicholas-oduor/News-API | ee52f775b20816edd61667ab2a08db23977708f2 | [
"MIT"
] | null | null | null | app/__init__.py | nicholas-oduor/News-API | ee52f775b20816edd61667ab2a08db23977708f2 | [
"MIT"
] | null | null | null | app/__init__.py | nicholas-oduor/News-API | ee52f775b20816edd61667ab2a08db23977708f2 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from config import config_options
bootstrap = Bootstrap()
def create_app(config_name):
app = Flask(__name__)
# Creating the app configurations
app.config.from_object(config_options[config_name])
# Initializing flask extensions
bootst... | 22.333333 | 55 | 0.751244 |
81f0348c6f36bf839409016f641e8cf98edac51c | 9,045 | py | Python | pybamm/solvers/algebraic_solver.py | dion-w/PyBaMM | aeb9bcc82bb5dc3fba4fa045c4cad9d2d41b6359 | [
"BSD-3-Clause"
] | 1 | 2022-03-24T01:23:16.000Z | 2022-03-24T01:23:16.000Z | pybamm/solvers/algebraic_solver.py | sxwangxiang/PyBaMM | 23157aebce218444edc83b525dfb2c7fc8637598 | [
"BSD-3-Clause"
] | null | null | null | pybamm/solvers/algebraic_solver.py | sxwangxiang/PyBaMM | 23157aebce218444edc83b525dfb2c7fc8637598 | [
"BSD-3-Clause"
] | null | null | null | #
# Algebraic solver class
#
import casadi
import pybamm
import numpy as np
from scipy import optimize
from scipy.sparse import issparse
class AlgebraicSolver(pybamm.BaseSolver):
"""Solve a discretised model which contains only (time independent) algebraic
equations using a root finding algorithm.
Uses sc... | 38.164557 | 88 | 0.487341 |
425c38c1b2293f035d02b0ea3a933f65fdd0c526 | 6,278 | py | Python | train.py | orris27/nus_cs5242_project_group27 | 2aa5722e8d9d722ff1a3a37f36cb35c1ece481f8 | [
"MIT"
] | null | null | null | train.py | orris27/nus_cs5242_project_group27 | 2aa5722e8d9d722ff1a3a37f36cb35c1ece481f8 | [
"MIT"
] | null | null | null | train.py | orris27/nus_cs5242_project_group27 | 2aa5722e8d9d722ff1a3a37f36cb35c1ece481f8 | [
"MIT"
] | null | null | null | import json
import os
import csv
import numpy as np
import misc.utils as utils
import opts
import torch
import torch.optim as optim
from torch.nn.utils import clip_grad_value_
from dataloader import VideoDataset
from models import DecoderRNN, EncoderRNN, S2VTAttModel, S2VTModel
from torch import nn
from torch.utils.d... | 37.369048 | 119 | 0.592386 |
83859ff6cd23ae768dfb7ad1de6da818f55659c7 | 1,558 | py | Python | nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 7 | 2017-02-17T08:54:26.000Z | 2022-03-10T20:57:23.000Z | nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 1 | 2016-04-25T15:07:09.000Z | 2016-04-25T15:07:09.000Z | nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 2 | 2017-09-23T16:22:00.000Z | 2019-08-01T14:18:52.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..dti import ComputeMeanDiffusivity
def test_ComputeMeanDiffusivity_inputs():
input_map = dict(
args=dict(argstr='%s', ),
environ=dict(
nohash=True,
usedefault=True,
)... | 29.961538 | 67 | 0.56611 |
92b248bfaa9d8433be2c2db26b6344fff3a2bfc7 | 1,502 | py | Python | docker/src/clawpack-5.3.1/pyclaw/development/DMPFOR/dmpfor_test.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 11 | 2017-01-04T18:19:48.000Z | 2021-02-21T01:46:33.000Z | docker/src/clawpack-5.3.1/pyclaw/development/DMPFOR/dmpfor_test.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 8 | 2016-09-22T20:49:51.000Z | 2019-09-06T23:28:13.000Z | docker/src/clawpack-5.3.1/pyclaw/development/DMPFOR/dmpfor_test.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 13 | 2016-09-22T20:20:06.000Z | 2020-07-13T14:48:32.000Z | from petsc4py import PETSc
import numpy as np
import DMPFOR
global_nx =3
global_ny =2
dof=4
da = PETSc.DA().create(dim=2,
dof=dof,
sizes=[global_nx, global_ny],
#periodic_type = PETSc.DA.PeriodicType.GHOSTED_XYZ,
#stencil_type=self.STENCIL,
#stencil_width=2,
comm=PETSc.COMM_WORLD)
gVec = da.createGlobalVector()
... | 18.775 | 80 | 0.695739 |
89f4e19917d007b2e6a7fa7d129c98923f44ee4f | 34,453 | py | Python | other_layer/transferleraning_v4(mix7)/retrain.py | yuwei998/Deep_Transfer | 41ebb3bb096f5fc417a900bd539650fd65189554 | [
"MIT"
] | 4 | 2018-07-31T01:49:14.000Z | 2020-07-21T11:30:41.000Z | other_layer/transferleraning_v4(mix7)/retrain.py | yuwei998/Deep_Transfer | 41ebb3bb096f5fc417a900bd539650fd65189554 | [
"MIT"
] | null | null | null | other_layer/transferleraning_v4(mix7)/retrain.py | yuwei998/Deep_Transfer | 41ebb3bb096f5fc417a900bd539650fd65189554 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from datetime import datetime
import hashlib
import os.path
import random
import re
import struct
import sys
import tarfile
import numpy as np
from six.moves import url... | 42.170135 | 139 | 0.660639 |
647f8525ea1cd51334edcc27015a7bf1913e7b9b | 9,177 | py | Python | fice_nike/agent_base.py | kenoss/FightingICE-nike | e8a38207481c20fc764271b5cc35b462caff5d49 | [
"Apache-2.0"
] | null | null | null | fice_nike/agent_base.py | kenoss/FightingICE-nike | e8a38207481c20fc764271b5cc35b462caff5d49 | [
"Apache-2.0"
] | null | null | null | fice_nike/agent_base.py | kenoss/FightingICE-nike | e8a38207481c20fc764271b5cc35b462caff5d49 | [
"Apache-2.0"
] | null | null | null | # Camel case is necesarry...
from .action import Action
class AgentBase:
THRESHOLD_FRAME_COUNT_FOR_THE_CASE_SIMULATOR_BROKEN = 30
def __init__(self, environment):
self.environment = environment
self.gateway = environment.gateway
self._skill_flag_continue_count = 0
def close(se... | 37.610656 | 123 | 0.57546 |
fcb771fb539cc232cb8a9aa82cbaabf99615b2d4 | 6,154 | py | Python | requests_ntlm2/requests_ntlm2.py | jkugler/requests-ntlm2 | d5cc3a39b228fb2f3d95275101cfbff17aeb8e07 | [
"ISC"
] | null | null | null | requests_ntlm2/requests_ntlm2.py | jkugler/requests-ntlm2 | d5cc3a39b228fb2f3d95275101cfbff17aeb8e07 | [
"ISC"
] | null | null | null | requests_ntlm2/requests_ntlm2.py | jkugler/requests-ntlm2 | d5cc3a39b228fb2f3d95275101cfbff17aeb8e07 | [
"ISC"
] | null | null | null | from requests.auth import AuthBase
from .core import NtlmCompatibility, get_auth_type_from_header, get_cbt_data, get_ntlm_credentials
from .dance import HttpNtlmContext
class HttpNtlmAuth(AuthBase):
"""
HTTP NTLM Authentication Handler for Requests.
"""
def __init__(
self, username,
... | 38.949367 | 99 | 0.646246 |
0c1e1749f59edad319e9a16cb6bbe124b8d66541 | 4,034 | py | Python | research/deeplab/core/nas_network_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | research/deeplab/core/nas_network_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | research/deeplab/core/nas_network_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 36.017857 | 81 | 0.602132 |
ccd4bd7ae371a3e8ef31161b4f230ef64a90a758 | 8,889 | py | Python | vb_suite/timeseries.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2019-05-21T21:07:03.000Z | 2019-05-21T21:07:03.000Z | vb_suite/timeseries.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | vb_suite/timeseries.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
from datetime import timedelta
N = 100000
try:
rng = date_range('1/1/2000', periods=N, freq='min')
except NameError:
rng = DateRange('1/1/2000', periods=N, offset=datetools.Minute())
def date_ra... | 29.828859 | 80 | 0.598155 |
97348efc2664c26be58cbba88e5496b35ff1850b | 180 | py | Python | 155A I_love_username.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | 1 | 2021-01-29T16:30:09.000Z | 2021-01-29T16:30:09.000Z | 155A I_love_username.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | 155A I_love_username.py | YasirAhmad-EccentriX/CodeForces | d004b4d1b52a360ac6c06870e0a237345771e32c | [
"MIT"
] | null | null | null | l=input()
l=[int(i) for i in input().split()]
max=min=l[0]
c=0
for i in l:
if i<min:
min=i
c+=1
elif i>max:
max=i
c+=1
print(c)
| 13.846154 | 36 | 0.422222 |
927bfa24e1d71afb6273413689d5949daa62d59c | 9,490 | py | Python | DPrepB-C/ska_sip/imageoperations/images/deconvolution.py | SKA-ScienceDataProcessor/SIP-DPrep | 7b98bfa4d9f76c6f8bafcb97613e2533cc9426fd | [
"Apache-2.0"
] | 1 | 2019-01-23T13:03:42.000Z | 2019-01-23T13:03:42.000Z | DPrepB-C/ska_sip/imageoperations/images/deconvolution.py | SKA-ScienceDataProcessor/SIP-DPrep | 7b98bfa4d9f76c6f8bafcb97613e2533cc9426fd | [
"Apache-2.0"
] | null | null | null | DPrepB-C/ska_sip/imageoperations/images/deconvolution.py | SKA-ScienceDataProcessor/SIP-DPrep | 7b98bfa4d9f76c6f8bafcb97613e2533cc9426fd | [
"Apache-2.0"
] | null | null | null | """deconvolution.py: A script for deconvolution of polarisation data."""
import numpy as np
import logging
LOG = logging.getLogger(__name__)
from data_models.memory_data_models import Image
from data_models.parameters import get_parameter
from libs.image.operations import create_image_from_array
from libs.image.clea... | 52.142857 | 348 | 0.589252 |
d780829a1f5101333577a1ca9adcb960529213f1 | 595 | py | Python | mathematics_dataset/util/__init__.py | PhysicsTeacher13/Mathematics_Dataset | 7f13bf661e6f36d61542bf0360b27f31eb9efe20 | [
"Apache-2.0"
] | 1,577 | 2019-04-03T10:05:30.000Z | 2022-03-29T17:56:14.000Z | mathematics_dataset/util/__init__.py | aliceheiman/mathematics_dataset | 89a928868d832d47387f704d2122c71e530ec4aa | [
"Apache-2.0"
] | 15 | 2019-04-03T18:55:03.000Z | 2022-01-12T16:04:12.000Z | mathematics_dataset/util/__init__.py | LaudateCorpus1/mathematics_dataset | e91dba649b843597c14b9d84dfe92bff79b7d299 | [
"Apache-2.0"
] | 226 | 2019-04-03T13:28:36.000Z | 2022-03-27T18:41:01.000Z | # Copyright 2018 DeepMind Technologies Limited.
#
# 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 ag... | 42.5 | 74 | 0.766387 |
4e9156ffc791e3e2811aa46b95358606f0797154 | 5,000 | py | Python | pyquil/api/tests/test_rewrite_arithmetic.py | dwillmer/pyquil | f9a8504d20729b79f07ec4730c93f4b84d6439eb | [
"Apache-2.0"
] | 1 | 2021-11-30T21:03:15.000Z | 2021-11-30T21:03:15.000Z | pyquil/api/tests/test_rewrite_arithmetic.py | dwillmer/pyquil | f9a8504d20729b79f07ec4730c93f4b84d6439eb | [
"Apache-2.0"
] | null | null | null | pyquil/api/tests/test_rewrite_arithmetic.py | dwillmer/pyquil | f9a8504d20729b79f07ec4730c93f4b84d6439eb | [
"Apache-2.0"
] | null | null | null | from pyquil.quil import Program
from pyquil.quilatom import Qubit, Frame
from pyquil.quilbase import DefFrame
from pyquil.api._rewrite_arithmetic import rewrite_arithmetic
from rpcq.messages import (
ParameterAref,
ParameterSpec,
RewriteArithmeticResponse,
)
def test_rewrite_arithmetic_no_params():
pr... | 33.783784 | 94 | 0.5956 |
40b4cf17405e86a4ac753ac882c29f49e76565ab | 417 | py | Python | Python/WebDev/Django/Tutorial/blog/models.py | michaelg29/Programming | 2544a742393c6d94e93879f70246ce17d0997011 | [
"MIT"
] | 2 | 2021-04-05T20:44:54.000Z | 2022-01-13T05:25:11.000Z | Python/WebDev/Django/Tutorial/blog/models.py | michaelg29/Programming | 2544a742393c6d94e93879f70246ce17d0997011 | [
"MIT"
] | 12 | 2020-02-17T05:19:01.000Z | 2022-03-17T14:56:38.000Z | Python/WebDev/Django/Tutorial/blog/models.py | michaelg29/Programming | 2544a742393c6d94e93879f70246ce17d0997011 | [
"MIT"
] | 1 | 2022-01-25T16:48:21.000Z | 2022-01-25T16:48:21.000Z | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
class Post(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
date_posted = models.DateTimeField(default=timezone.now)
author = models.ForeignKey(User, on_delete... | 32.076923 | 93 | 0.7506 |
3b098121ab4d928e9c805659b286849202350960 | 5,820 | py | Python | bin/train.py | koreyou/multidomain-sentiment | 766afdb839483c38a141c8d1d60c6faa75bd2684 | [
"CC0-1.0"
] | null | null | null | bin/train.py | koreyou/multidomain-sentiment | 766afdb839483c38a141c8d1d60c6faa75bd2684 | [
"CC0-1.0"
] | null | null | null | bin/train.py | koreyou/multidomain-sentiment | 766afdb839483c38a141c8d1d60c6faa75bd2684 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import logging
import os
import chainer
import dill # This is for joblib to use dill. Do NOT delete it.
import click
import six
from chainer import training
from chainer.training import extensions
from joblib import ... | 40.137931 | 80 | 0.673883 |
a8e2a35e4a1aae11f736a4bc966684c90698fe90 | 414 | py | Python | setup.py | knu2xs/arcgis-demographic-clustering | 1cccd4b534c565321cf8d6ca6b68c41bccd74a62 | [
"Apache-2.0"
] | null | null | null | setup.py | knu2xs/arcgis-demographic-clustering | 1cccd4b534c565321cf8d6ca6b68c41bccd74a62 | [
"Apache-2.0"
] | null | null | null | setup.py | knu2xs/arcgis-demographic-clustering | 1cccd4b534c565321cf8d6ca6b68c41bccd74a62 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
with open('README.md', 'r') as readme:
long_description = readme.read()
setup(
name='arcgis_clustering',
package_dir={"": "src"},
packages=find_packages('src'),
version='0.0.0',
description='Demographic clutering using ArcGIS Business Analyst data.',... | 25.875 | 76 | 0.693237 |
a0474ac8bb9b302c61d3f34f3986d4545d168782 | 2,004 | py | Python | utils/framework.py | kosuke55/DeepDepthDenoising | b1e7b95ca2e03384005b0540f865ddc7066a3e93 | [
"MIT"
] | 1 | 2020-04-15T16:46:56.000Z | 2020-04-15T16:46:56.000Z | utils/framework.py | panluDreamer/DeepDepthDenoising | a994f495cd90193c78c1824367ce1462ae52752f | [
"MIT"
] | null | null | null | utils/framework.py | panluDreamer/DeepDepthDenoising | a994f495cd90193c78c1824367ce1462ae52752f | [
"MIT"
] | null | null | null | import torch
import datetime
import numpy
import random
from .opt import *
from .visualization import *
def initialize(args):
# create and init device
print("{} | Torch Version: {}".format(datetime.datetime.now(), torch.__version__))
if args.seed > 0:
print("Set to reproducibility mode with seed... | 40.897959 | 129 | 0.662675 |
6b7f95a2d4b1f51013bb067d31447975b02bd2ea | 2,512 | py | Python | alembic/versions/67c47a7c2029_add_unique_constraints_and_indices.py | hasadna/open-bus-stride-db | 368ef4ca8b6916ad1a502b9445cd47e27aa778b4 | [
"MIT"
] | null | null | null | alembic/versions/67c47a7c2029_add_unique_constraints_and_indices.py | hasadna/open-bus-stride-db | 368ef4ca8b6916ad1a502b9445cd47e27aa778b4 | [
"MIT"
] | 2 | 2022-01-17T11:07:33.000Z | 2022-03-18T08:17:48.000Z | alembic/versions/67c47a7c2029_add_unique_constraints_and_indices.py | hasadna/open-bus-stride-db | 368ef4ca8b6916ad1a502b9445cd47e27aa778b4 | [
"MIT"
] | null | null | null | """add unique constraints and indices
Revision ID: 67c47a7c2029
Revises: 366df3cd0db1
Create Date: 2021-11-07 17:14:06.435914+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '67c47a7c2029'
down_revision = '366df3cd0db1'
branch_labels = None
depends_on = N... | 53.446809 | 133 | 0.761943 |
96f5cbda9d91e34242c631f749cd0a20e2da47c6 | 1,208 | py | Python | Software/Backend/app/model/Usuario.py | davidsgv/Sistemas-Transaccionales | a26904742bd163461aca7e8039448441b4a98fb9 | [
"MIT"
] | null | null | null | Software/Backend/app/model/Usuario.py | davidsgv/Sistemas-Transaccionales | a26904742bd163461aca7e8039448441b4a98fb9 | [
"MIT"
] | null | null | null | Software/Backend/app/model/Usuario.py | davidsgv/Sistemas-Transaccionales | a26904742bd163461aca7e8039448441b4a98fb9 | [
"MIT"
] | null | null | null | from app.model.Base import selectDB, insertBD
from uuid import uuid4
from flask import request
class ManejoUsuarios():
@staticmethod
def IniciarSesion(correo, contrasena, navegador):
#Verificar datos de usuario
query = "EXEC dbo.spVerificarDatosUsuario @correo = '{}', @clave = '{}'".format(cor... | 26.26087 | 121 | 0.572848 |
fdb6c1e04052045149030c71061aaa1b9e7e7506 | 5,704 | py | Python | ParlAI/parlai/tasks/fvqa/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 163 | 2019-06-23T14:07:57.000Z | 2022-02-25T23:06:07.000Z | ParlAI/parlai/tasks/fvqa/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 8 | 2019-07-24T12:41:31.000Z | 2022-02-10T00:17:20.000Z | ParlAI/parlai/tasks/fvqa/agents.py | UmaTaru/run | be29e4d41a4de3dee27cd6796801bfe51382d294 | [
"MIT"
] | 31 | 2019-06-26T01:21:07.000Z | 2021-09-06T17:23:24.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.agents import Teacher
from parlai.core.image_featurizers import ImageLoader
from parlai.core.metrics im... | 32.781609 | 88 | 0.596599 |
8b3ee71c2d5b8458d11f059bceb2555813acc48b | 10,324 | py | Python | glm-plotter/GLMparser.py | jdechalendar/glmplotter | e715d4c646d739d906f96db075b2995fcf02da72 | [
"MIT"
] | 6 | 2017-03-03T04:07:47.000Z | 2020-08-24T13:44:19.000Z | glm-plotter/GLMparser.py | jdechalendar/glmplotter | e715d4c646d739d906f96db075b2995fcf02da72 | [
"MIT"
] | 4 | 2018-12-10T02:42:35.000Z | 2019-07-20T19:22:02.000Z | glm-plotter/GLMparser.py | jdechalendar/glm-plotter | e715d4c646d739d906f96db075b2995fcf02da72 | [
"MIT"
] | 6 | 2016-08-25T17:16:25.000Z | 2020-06-19T05:53:39.000Z | """
JAC - jdechalendar@stanford.edu
"""
import pandas as pd
import re
def readGLM(iFile, verb=0):
"""
Main function to parse GLM files
Modified July 12, 2016 - the returned objs are now a list
Use list comprehensions to extract list of objects of a given class
"""
with open(iFile) as f:
... | 39.555556 | 87 | 0.537389 |
eb697021280c40e8705ae0b0ff0b6471fb050e43 | 401 | py | Python | backend/z_vent_30438/wsgi.py | crowdbotics-apps/z-vent-30438 | d06342c9a6a8feb2f5a2c75c90c2b14d4ab59110 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/z_vent_30438/wsgi.py | crowdbotics-apps/z-vent-30438 | d06342c9a6a8feb2f5a2c75c90c2b14d4ab59110 | [
"FTL",
"AML",
"RSA-MD"
] | 6 | 2021-09-14T01:39:57.000Z | 2021-10-31T15:32:36.000Z | backend/z_vent_30438/wsgi.py | crowdbotics-apps/z-vent-30438 | d06342c9a6a8feb2f5a2c75c90c2b14d4ab59110 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for z_vent_30438 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
ac6655b69a0182b23cb4f11995ab808e3baf1f0e | 4,411 | py | Python | goodsorigin/views.py | caiwei-0627/GreaterWMS | db3d7b200343fd9eea07fa3fcdf33c4c9c37c4b4 | [
"Apache-2.0"
] | 3 | 2020-10-19T05:55:28.000Z | 2020-11-12T03:55:06.000Z | goodsorigin/views.py | coolflywms/GreaterWMS | 0509b8842bbd8cae9540b6f13f7b3cb6fa5a911c | [
"Apache-2.0"
] | 1 | 2020-07-24T07:34:36.000Z | 2020-07-24T07:34:36.000Z | goodsorigin/views.py | Singosgu/Elvis_WMS | e6911b7daae76be640ece8946104af24b6cf0fa6 | [
"MIT"
] | 4 | 2020-09-04T13:35:15.000Z | 2020-10-16T15:10:38.000Z | from rest_framework import viewsets
from .models import ListModel
from . import serializers
from utils.page import MyPageNumberPagination
from rest_framework.filters import OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.response import Response
from .filter import Filte... | 39.035398 | 129 | 0.643845 |
bdc790faf745b81e8e0f4c0e50f296a38fbc9819 | 1,893 | py | Python | examples/plot_scalar_example.py | stevegolton/toppra | 846e2a7f5b87e0e1884b244b07d5fd661edcd9bd | [
"MIT"
] | 342 | 2017-07-26T17:37:19.000Z | 2022-03-28T19:50:27.000Z | examples/plot_scalar_example.py | stevegolton/toppra | 846e2a7f5b87e0e1884b244b07d5fd661edcd9bd | [
"MIT"
] | 151 | 2017-11-30T06:14:29.000Z | 2022-03-29T02:06:08.000Z | examples/plot_scalar_example.py | stevegolton/toppra | 846e2a7f5b87e0e1884b244b07d5fd661edcd9bd | [
"MIT"
] | 134 | 2017-08-18T21:35:39.000Z | 2022-03-25T03:43:08.000Z | """
Retime an one dimensional path
===============================
"""
################################################################################
# Import necessary libraries.
import toppra as ta
import toppra.constraint as constraint
import toppra.algorithm as algo
import numpy as np
import matplotlib.pyplot as ... | 35.055556 | 80 | 0.570523 |
0463f9ce01c4566ca0abd0498408cb78e4fc78e9 | 5,101 | py | Python | tests/applier/data_postgres_cdc_applier_inactive_applied_tables.py | albertteoh/data_pipeline | a99f1c7412375b3e9f4115108fcdde517b2e71a6 | [
"Apache-2.0"
] | 16 | 2017-10-31T21:43:26.000Z | 2019-08-11T08:49:06.000Z | tests/applier/data_postgres_cdc_applier_inactive_applied_tables.py | albertteoh/data_pipeline | a99f1c7412375b3e9f4115108fcdde517b2e71a6 | [
"Apache-2.0"
] | 1 | 2017-11-01T06:25:56.000Z | 2017-11-01T06:25:56.000Z | tests/applier/data_postgres_cdc_applier_inactive_applied_tables.py | albertteoh/data_pipeline | a99f1c7412375b3e9f4115108fcdde517b2e71a6 | [
"Apache-2.0"
] | 9 | 2017-10-30T05:23:15.000Z | 2022-02-17T03:53:09.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... | 56.677778 | 476 | 0.662223 |
d5c9c1544b8161150890e15486242a4e0a5dba41 | 314 | py | Python | Chapter 15/setup.py | bpbpublications/Building-Smart-Robots-Using-ROS | 62f473d0cc94966806c1b66f46e9fba812080338 | [
"MIT"
] | null | null | null | Chapter 15/setup.py | bpbpublications/Building-Smart-Robots-Using-ROS | 62f473d0cc94966806c1b66f46e9fba812080338 | [
"MIT"
] | null | null | null | Chapter 15/setup.py | bpbpublications/Building-Smart-Robots-Using-ROS | 62f473d0cc94966806c1b66f46e9fba812080338 | [
"MIT"
] | null | null | null | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['object_detection'],
package_dir={'': 'src'})
setup(**setup_args)
| 26.166667 | 61 | 0.770701 |
719e8a2e317b25455d76f9746824548d25aebbbb | 5,804 | py | Python | Code/convertor.py | Helvboy/Semester-Project | d1bd2349ff8833178eb6120fd99ad668eadb25e0 | [
"Unlicense"
] | null | null | null | Code/convertor.py | Helvboy/Semester-Project | d1bd2349ff8833178eb6120fd99ad668eadb25e0 | [
"Unlicense"
] | null | null | null | Code/convertor.py | Helvboy/Semester-Project | d1bd2349ff8833178eb6120fd99ad668eadb25e0 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon May 3 20:37:20 2021
@author: Eloi Schlegel
"""
import numpy as np
def cloud_points_to_pixels(points, densities, resolution=0.1):
"""
Transform the a cloud points into a pixelized image
N - number of points \n
D - number of dimensions \n... | 25.795556 | 83 | 0.56306 |
7776b8a64df60f519435997d51ff89a7bdc6ba00 | 1,278 | py | Python | test.py | TimSC/pgmap-query | 02a274172ec651e41db89bffd7b11d1f91eb5488 | [
"MIT"
] | 2 | 2018-09-01T00:32:35.000Z | 2019-03-24T15:10:41.000Z | test.py | TimSC/pgmap-query | 02a274172ec651e41db89bffd7b11d1f91eb5488 | [
"MIT"
] | 5 | 2018-02-05T01:53:48.000Z | 2019-05-12T20:22:14.000Z | test.py | TimSC/pgmap-query | 02a274172ec651e41db89bffd7b11d1f91eb5488 | [
"MIT"
] | 1 | 2021-03-18T10:15:41.000Z | 2021-03-18T10:15:41.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import pgmap
import io
import string
def ReadConfig(fina):
fi = open(fina, "rt")
settings = {}
for li in fi.readlines():
lisp = map(string.strip, li.split(":"))
if len(lisp) < 2:
continue
settings[lisp[0]]... | 25.058824 | 83 | 0.680751 |
7f212436c965591733004b7d0df70a2f3cb122f6 | 14,507 | py | Python | actstream/tests.py | lincolnloop/django-activity-stream | b1b4884624fab982b35fbcbd28ed321d12e3d054 | [
"BSD-3-Clause"
] | null | null | null | actstream/tests.py | lincolnloop/django-activity-stream | b1b4884624fab982b35fbcbd28ed321d12e3d054 | [
"BSD-3-Clause"
] | null | null | null | actstream/tests.py | lincolnloop/django-activity-stream | b1b4884624fab982b35fbcbd28ed321d12e3d054 | [
"BSD-3-Clause"
] | null | null | null | from random import choice
from django.db import connection
from django.db.models import get_model
from django.test import TestCase
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser, Group
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.mode... | 39.52861 | 88 | 0.636934 |
144e88c9c9e7499ac681e175f75900f7f928ce83 | 6,435 | py | Python | src/kubernetes/client/models/v1alpha1_pod_preset_spec.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 184 | 2017-12-20T21:50:06.000Z | 2022-03-19T13:24:58.000Z | src/kubernetes/client/models/v1alpha1_pod_preset_spec.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 15 | 2018-01-17T17:30:51.000Z | 2021-12-16T14:25:09.000Z | src/kubernetes/client/models/v1alpha1_pod_preset_spec.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 136 | 2018-01-09T22:52:06.000Z | 2022-02-24T13:26:18.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | 28.986486 | 105 | 0.591919 |
5be70be1f368fd47d6033ba61c4c6b57b87df8e1 | 1,248 | py | Python | src/surveys18/tests/test_phone.py | wups101/alss-dev | 6dde342e4de4f0d94df2769e83f6fefc79100daf | [
"MIT"
] | null | null | null | src/surveys18/tests/test_phone.py | wups101/alss-dev | 6dde342e4de4f0d94df2769e83f6fefc79100daf | [
"MIT"
] | null | null | null | src/surveys18/tests/test_phone.py | wups101/alss-dev | 6dde342e4de4f0d94df2769e83f6fefc79100daf | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.core.management import call_command
from surveys18.models import Survey, Phone
class ModelTestCase(TestCase):
"""
models: Phone, Survey
reference models :
data: phone.yaml, survey.yaml
main: Phone associate survey, the one farmer has many phones.
""... | 29.023256 | 74 | 0.680288 |
7aa22d7aaebbee0c3af1bc76393c2ea52f68638b | 5,807 | py | Python | src/python/ensembl/production/datafile/scraper/parsers/base.py | luca-drf/ensembl-production | 8251026004d786f5a160584f3550227adc395cc1 | [
"Apache-2.0"
] | null | null | null | src/python/ensembl/production/datafile/scraper/parsers/base.py | luca-drf/ensembl-production | 8251026004d786f5a160584f3550227adc395cc1 | [
"Apache-2.0"
] | null | null | null | src/python/ensembl/production/datafile/scraper/parsers/base.py | luca-drf/ensembl-production | 8251026004d786f5a160584f3550227adc395cc1 | [
"Apache-2.0"
] | null | null | null | # See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
# 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... | 31.053476 | 90 | 0.64715 |
c6caf9c84eb2f194be4efeebf8974f24b922ee30 | 565 | py | Python | actor_critic.py | escribano89/tennis-maddpg | f7877bdb0a9f9e773b3d4a1d4847338b9cea9a8e | [
"MIT"
] | null | null | null | actor_critic.py | escribano89/tennis-maddpg | f7877bdb0a9f9e773b3d4a1d4847338b9cea9a8e | [
"MIT"
] | null | null | null | actor_critic.py | escribano89/tennis-maddpg | f7877bdb0a9f9e773b3d4a1d4847338b9cea9a8e | [
"MIT"
] | 1 | 2020-12-20T19:07:42.000Z | 2020-12-20T19:07:42.000Z | # -*- coding: utf-8 -*-
from actor import Actor
from critic import Critic
from params import DEVICE
class ActorCritic():
def __init__(self, n_agents, state_size, action_size, seed):
critic_input_size = (state_size+action_size)*n_agents
self.actor_regular = Actor(state_size, action_size, s... | 37.666667 | 76 | 0.704425 |
0a1e93fae4f966a6c5026ee3e224d1fcac5d0c1b | 747 | py | Python | RIT33PYT/Codigo_1/DesignPattern/recordar.py | Sbastdia/Ejercicios-probables-examen | 1074dcb08c5daf7bda0c0e9bbacb96c991895f32 | [
"Apache-2.0"
] | null | null | null | RIT33PYT/Codigo_1/DesignPattern/recordar.py | Sbastdia/Ejercicios-probables-examen | 1074dcb08c5daf7bda0c0e9bbacb96c991895f32 | [
"Apache-2.0"
] | null | null | null | RIT33PYT/Codigo_1/DesignPattern/recordar.py | Sbastdia/Ejercicios-probables-examen | 1074dcb08c5daf7bda0c0e9bbacb96c991895f32 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Patrón de diseño Llamada
"""
__author__ = "Sébastien CHAZALLET"
__copyright__ = "Copyright 2012"
__credits__ = ["Sébastien CHAZALLET", "InsPyration.org", "Ediciones ENI"]
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "Sébastien CHAZALLET"
__email__ = "sebast... | 17.372093 | 73 | 0.690763 |
b0b5428493f6de53bbe201bdb2b321e0e7be21ed | 54,969 | py | Python | tinytag/tinytag.py | russpoutine/tinytag | 2c03b0b4b15056feb7c8051fa39728bcd71be30d | [
"MIT"
] | null | null | null | tinytag/tinytag.py | russpoutine/tinytag | 2c03b0b4b15056feb7c8051fa39728bcd71be30d | [
"MIT"
] | null | null | null | tinytag/tinytag.py | russpoutine/tinytag | 2c03b0b4b15056feb7c8051fa39728bcd71be30d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# tinytag - an audio meta info reader
# Copyright (c) 2014-2018 Tom Wallroth
#
# Sources on github:
# http://github.com/devsnd/tinytag/
# MIT License
# Copyright (c) 2014-2019 Tom Wallroth
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | 47.79913 | 143 | 0.563045 |
36b9b7cc4c139f1a3a4d25488217c2bcf4f3365f | 4,898 | py | Python | app/user/tests/test_user_api.py | carlos28d/recipe-app-api | 1eb7e4958124f20c126211a22157fe9c6eed2ff2 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | carlos28d/recipe-app-api | 1eb7e4958124f20c126211a22157fe9c6eed2ff2 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | carlos28d/recipe-app-api | 1eb7e4958124f20c126211a22157fe9c6eed2ff2 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**params... | 34.492958 | 77 | 0.645978 |
1650e3e721c1c931a323dd61363042ea35b8ce27 | 2,005 | py | Python | src/jk_jsoncfghelper2/jdef.py | jkpubsrc/python-module-jk-jsoncfghelper2 | 2c584c946db5d290525ff49f5c809cec14616247 | [
"Apache-1.1"
] | null | null | null | src/jk_jsoncfghelper2/jdef.py | jkpubsrc/python-module-jk-jsoncfghelper2 | 2c584c946db5d290525ff49f5c809cec14616247 | [
"Apache-1.1"
] | null | null | null | src/jk_jsoncfghelper2/jdef.py | jkpubsrc/python-module-jk-jsoncfghelper2 | 2c584c946db5d290525ff49f5c809cec14616247 | [
"Apache-1.1"
] | null | null | null |
from typing import Union
class JDefStructure(object):
def __init__(self, name:str, structure:Union[list,tuple]):
assert isinstance(name, str)
assert isinstance(structure, (list, tuple))
self.name = name
self.structure = structure
#
#def cloneObject(self):
# return JDefStructure(self.name, list(sel... | 20.252525 | 86 | 0.710224 |
3f5ba386936e94191a349b3fa5b8a2079c7e585b | 31,184 | py | Python | pymatgen/analysis/adsorption.py | robertcdickson/pymatgen | fb65122a7c471b9ffd0d01f2341339fb1dee2af1 | [
"MIT"
] | null | null | null | pymatgen/analysis/adsorption.py | robertcdickson/pymatgen | fb65122a7c471b9ffd0d01f2341339fb1dee2af1 | [
"MIT"
] | null | null | null | pymatgen/analysis/adsorption.py | robertcdickson/pymatgen | fb65122a7c471b9ffd0d01f2341339fb1dee2af1 | [
"MIT"
] | null | null | null | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes used to enumerate surface sites
and to find adsorption sites on slabs
"""
import itertools
import os
import numpy as np
from matplotlib import patches
from matplotlib.path import Path
from m... | 41.303311 | 119 | 0.614129 |
82fbe0bd2fb66507cf7c0660328063a4fdbe037b | 12,166 | py | Python | .github/scripts/test_trymerge.py | qqaatw/pytorch | 44764f131b040a41a6dcf1304bb635c574bf5a3b | [
"Intel"
] | null | null | null | .github/scripts/test_trymerge.py | qqaatw/pytorch | 44764f131b040a41a6dcf1304bb635c574bf5a3b | [
"Intel"
] | null | null | null | .github/scripts/test_trymerge.py | qqaatw/pytorch | 44764f131b040a41a6dcf1304bb635c574bf5a3b | [
"Intel"
] | null | null | null | #!/usr/bin/env python3
# Tests implemented in this file are relying on GitHub GraphQL APIs
# In order to avoid test flakiness, results of the queries
# are cached in gql_mocks.json
# PyTorch Lint workflow does not have GITHUB_TOKEN defined to avoid
# flakiness, so if you are making changes to merge_rules or
# GraphQL q... | 44.564103 | 131 | 0.639076 |
99aa125dcdf38bb38c1de50f1b2555d6a156c473 | 5,521 | py | Python | asposepdfcloud/models/annotations_info_response.py | kaferi/aspose-pdf-cloud-python | 48f70742fec1e41644ec0b658db3f174ba845304 | [
"MIT"
] | 7 | 2018-06-11T17:44:44.000Z | 2022-02-08T05:52:48.000Z | asposepdfcloud/models/annotations_info_response.py | kaferi/aspose-pdf-cloud-python | 48f70742fec1e41644ec0b658db3f174ba845304 | [
"MIT"
] | 1 | 2021-03-20T22:16:15.000Z | 2021-06-27T15:11:52.000Z | asposepdfcloud/models/annotations_info_response.py | kaferi/aspose-pdf-cloud-python | 48f70742fec1e41644ec0b658db3f174ba845304 | [
"MIT"
] | 4 | 2018-04-18T19:41:12.000Z | 2021-06-21T13:12:24.000Z | # coding: utf-8
"""
Aspose.PDF Cloud API Reference
Copyright (c) 2021 Aspose.PDF Cloud
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 r... | 27.605 | 78 | 0.600978 |
0d283fc4b23dffb2a4c96b15af72fafe06cd3d69 | 564 | py | Python | 05 - Basics of lists, keyboard control/motion_implicit.py | PableraShow/python-exercises | e1648fd42f3009ec6fb1e2096852b6d399e91d5b | [
"MIT"
] | 8 | 2018-10-01T17:35:57.000Z | 2022-02-01T08:12:12.000Z | 05 - Basics of lists, keyboard control/motion_implicit.py | PableraShow/python-exercises | e1648fd42f3009ec6fb1e2096852b6d399e91d5b | [
"MIT"
] | null | null | null | 05 - Basics of lists, keyboard control/motion_implicit.py | PableraShow/python-exercises | e1648fd42f3009ec6fb1e2096852b6d399e91d5b | [
"MIT"
] | 6 | 2018-07-22T19:15:21.000Z | 2022-02-05T07:54:58.000Z | # Ball motion with an implicit timer
import simplegui
# Initialize globals
WIDTH = 600
HEIGHT = 400
BALL_RADIUS = 20
ball_pos = [WIDTH / 2, HEIGHT / 2]
vel = [0, 1] # pixels per update (1/60 seconds)
# define event handlers
def draw(canvas):
# Update ball position
ball_pos[0] += vel[0]
ball_pos[1] += ve... | 18.8 | 64 | 0.693262 |
d6157dfb55b230dcfc9363cf23f59fea2f01b469 | 211 | py | Python | etlaas_stream/infrastructure.py | etlaas/etlaas-stream | 59f811807e0d639c8787c0676e39d5a8db20789f | [
"MIT"
] | null | null | null | etlaas_stream/infrastructure.py | etlaas/etlaas-stream | 59f811807e0d639c8787c0676e39d5a8db20789f | [
"MIT"
] | null | null | null | etlaas_stream/infrastructure.py | etlaas/etlaas-stream | 59f811807e0d639c8787c0676e39d5a8db20789f | [
"MIT"
] | null | null | null | import simplejson
from typing import Any
def default_loads(s: str) -> Any:
return simplejson.loads(s, use_decimal=True)
def default_dumps(d: Any) -> str:
return simplejson.dumps(d, use_decimal=True)
| 19.181818 | 48 | 0.734597 |
445fd79bf777773a2998a18aa6714d8c7129f5c6 | 7,373 | py | Python | DeblurGAN-tf/00-access/mode.py | NALLEIN/Ascend | dbe83758cc180b21c41661a1dfad399193a7851c | [
"Apache-2.0"
] | null | null | null | DeblurGAN-tf/00-access/mode.py | NALLEIN/Ascend | dbe83758cc180b21c41661a1dfad399193a7851c | [
"Apache-2.0"
] | null | null | null | DeblurGAN-tf/00-access/mode.py | NALLEIN/Ascend | dbe83758cc180b21c41661a1dfad399193a7851c | [
"Apache-2.0"
] | null | null | null | import os
import tensorflow as tf
from PIL import Image
import numpy as np
import time
import util
# from skimage.measure import compare_ssim as ssim
import data
def train(args, model, sess, saver):
if args.fine_tuning :
saver.restore(sess, args.pre_trained_model)
print("saved model is loaded for f... | 39.218085 | 158 | 0.606809 |
ef998d785a4046f92df56917e63bf9f47049b706 | 2,667 | py | Python | awd/embedding_mul_test.py | nkcr/overlap-ml | 58f55ae906f880b550f2fcf3fb56338678fd3d8f | [
"BSD-3-Clause"
] | 3 | 2019-11-14T22:43:41.000Z | 2021-04-15T03:59:57.000Z | awd/embedding_mul_test.py | nkcr/overlap-ml | 58f55ae906f880b550f2fcf3fb56338678fd3d8f | [
"BSD-3-Clause"
] | 7 | 2019-09-19T20:25:25.000Z | 2022-02-10T00:31:46.000Z | awd/embedding_mul_test.py | nkcr/overlap-ml | 58f55ae906f880b550f2fcf3fb56338678fd3d8f | [
"BSD-3-Clause"
] | 1 | 2020-05-28T23:34:43.000Z | 2020-05-28T23:34:43.000Z | import unittest
import mock
from mock import Mock
import numpy as np
from embedding_mul import EmbeddingMul
import torch
import argparse
import logging
"""Simple test class for EmbeddingMul class
Author: Noémien Kocher
Date: Fall 2018
Run this class with `python3 embedding_mul_test.py` or
`python... | 28.37234 | 76 | 0.523435 |
3829dc5e6917458072ee981267b831a394fae049 | 11,975 | py | Python | service/base.py | gregbugaj/TextGenerator | d92431bdce31914a108417f7b00ed80b8f994298 | [
"MIT"
] | null | null | null | service/base.py | gregbugaj/TextGenerator | d92431bdce31914a108417f7b00ed80b8f994298 | [
"MIT"
] | null | null | null | service/base.py | gregbugaj/TextGenerator | d92431bdce31914a108417f7b00ed80b8f994298 | [
"MIT"
] | null | null | null | from lxml.etree import Element, SubElement, tostring
from utils import log
import shutil
import json
import os
import cv2
import numpy as np
def get_pic_dir(out_put_dir):
img_dir = os.path.join(out_put_dir, "img")
pic_dir = os.path.join(img_dir, "pic")
return pic_dir
def get_fragment_dir(out_put_dir):
... | 32.808219 | 111 | 0.616868 |
9d09cd5f47132a0da099aaf61287672e2b6c2666 | 7,710 | py | Python | tests/base.py | helobinvn/jenkins-job-builder | c1d6ba6fbb7de6f9a98b35cfc1b84dcb0260f486 | [
"Apache-2.0"
] | null | null | null | tests/base.py | helobinvn/jenkins-job-builder | c1d6ba6fbb7de6f9a98b35cfc1b84dcb0260f486 | [
"Apache-2.0"
] | 5 | 2015-03-12T20:21:46.000Z | 2015-11-30T15:56:42.000Z | tests/base.py | helobinvn/jenkins-job-builder | c1d6ba6fbb7de6f9a98b35cfc1b84dcb0260f486 | [
"Apache-2.0"
] | 4 | 2015-10-15T08:41:49.000Z | 2019-01-04T07:22:36.000Z | #!/usr/bin/env python
#
# Joint copyright:
# - Copyright 2012,2013 Wikimedia Foundation
# - Copyright 2012,2013 Antoine "hashar" Musso
# - Copyright 2013 Arnaud Fabre
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | 35.860465 | 79 | 0.594553 |
ebdaf83ab179b6d328e4d2fac28ff19df82d82fd | 8,521 | py | Python | concept_explanations/ipca.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | concept_explanations/ipca.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | concept_explanations/ipca.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 33.547244 | 80 | 0.685366 |
2acef4966fd3250fb27f4a4d7579d498d736a0aa | 2,124 | py | Python | osna/cli.py | tapilab/elevate-osna-starter | 7cf11c302cbd210a21d633d966a612adc2fc81af | [
"MIT"
] | 1 | 2019-07-24T17:02:59.000Z | 2019-07-24T17:02:59.000Z | osna/cli.py | tapilab/elevate-osna-starter | 7cf11c302cbd210a21d633d966a612adc2fc81af | [
"MIT"
] | 2 | 2021-11-15T17:48:49.000Z | 2022-02-10T00:37:43.000Z | osna/cli.py | tapilab/elevate-osna-starter | 7cf11c302cbd210a21d633d966a612adc2fc81af | [
"MIT"
] | 1 | 2019-08-02T15:10:21.000Z | 2019-08-02T15:10:21.000Z | # -*- coding: utf-8 -*-
"""Console script for elevate_osna."""
import click
import glob
import pickle
import sys
import numpy as np
import pandas as pd
import re
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.linear_model import LogisticR... | 29.5 | 173 | 0.704802 |
05892971a4c5d642b6e1f03454772c86653f4a26 | 3,985 | py | Python | social/backends/exacttarget.py | SeanHayes/python-social-auth | 4d70b23eb603c1d9753a7982bd7b3bab7cf18d48 | [
"BSD-3-Clause"
] | 1 | 2016-02-06T03:08:09.000Z | 2016-02-06T03:08:09.000Z | social/backends/exacttarget.py | SeanHayes/python-social-auth | 4d70b23eb603c1d9753a7982bd7b3bab7cf18d48 | [
"BSD-3-Clause"
] | null | null | null | social/backends/exacttarget.py | SeanHayes/python-social-auth | 4d70b23eb603c1d9753a7982bd7b3bab7cf18d48 | [
"BSD-3-Clause"
] | 1 | 2016-09-02T13:08:22.000Z | 2016-09-02T13:08:22.000Z | """
ExactTarget OAuth support.
Support Authentication from IMH using JWT token and pre-shared key.
Requires package pyjwt
"""
from datetime import timedelta, datetime
import jwt
from social.exceptions import AuthFailed, AuthCanceled
from social.backends.oauth import BaseOAuth2
class ExactTargetOAuth2(BaseOAuth2):
... | 37.952381 | 79 | 0.568883 |
e58dd4cf2ae3188658bf2829ba425e9f5c51f8ab | 1,001 | py | Python | Projects/Online Workouts/w3resource/Tuple/program-1.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | 1 | 2019-09-23T15:51:45.000Z | 2019-09-23T15:51:45.000Z | Projects/Online Workouts/w3resource/Tuple/program-1.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | 5 | 2021-02-08T20:47:19.000Z | 2022-03-12T00:35:44.000Z | Projects/Online Workouts/w3resource/Tuple/program-1.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Creates a tuple. #
# Program ... | 45.5 | 92 | 0.317682 |
f077f05f5b4f71dcb8ebc94f6f32efe0cf096be1 | 8,066 | py | Python | Lib/test/test_docxmlrpc.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 854 | 2017-09-11T16:42:28.000Z | 2022-03-27T14:17:09.000Z | Lib/test/test_docxmlrpc.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 164 | 2017-09-24T20:40:32.000Z | 2021-10-30T01:35:05.000Z | Lib/test/test_docxmlrpc.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 73 | 2017-09-13T18:07:48.000Z | 2022-03-17T13:02:29.000Z | from xmlrpc.server import DocXMLRPCServer
import http.client
import sys
import threading
from test import support
import unittest
def make_request_and_skipIf(condition, reason):
# If we skip the test, we have to make a request because
# the server created in setUp blocks expecting one to come in.
if not co... | 40.532663 | 82 | 0.608976 |
8709bd76a3d888de0d87dc9379a2c2397c14ae37 | 10,250 | py | Python | simfempy/examples/paraview/drivencavity.py | beckerrh/simfempy | 10bf30f330d921bffaa8572bbd73286da5971905 | [
"MIT"
] | null | null | null | simfempy/examples/paraview/drivencavity.py | beckerrh/simfempy | 10bf30f330d921bffaa8572bbd73286da5971905 | [
"MIT"
] | 3 | 2018-12-18T16:36:52.000Z | 2019-01-29T18:34:55.000Z | simfempy/examples/paraview/drivencavity.py | beckerrh/fempy | dd7214ea7f6d81a5200fcb4a91f07a5cd3322e9e | [
"MIT"
] | 1 | 2021-06-09T15:49:51.000Z | 2021-06-09T15:49:51.000Z | # state file generated using paraview version 5.9.1
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# ----------------------------------------------------------------
# setup views used in the ... | 43.067227 | 174 | 0.728488 |
4a2adf8d6fc8370552eacd2a76f036bd8f3b50d9 | 4,497 | py | Python | indad/utils.py | theerawatramchuen/ind_knn_ad | 44720394c69c796d531d32e9a757c8526eef45cb | [
"MIT"
] | 75 | 2021-07-09T09:50:00.000Z | 2022-03-31T11:05:34.000Z | indad/utils.py | theerawatramchuen/ind_knn_ad | 44720394c69c796d531d32e9a757c8526eef45cb | [
"MIT"
] | 24 | 2021-07-22T10:04:28.000Z | 2022-03-11T00:07:30.000Z | indad/utils.py | theerawatramchuen/ind_knn_ad | 44720394c69c796d531d32e9a757c8526eef45cb | [
"MIT"
] | 28 | 2021-07-24T18:03:25.000Z | 2022-02-09T10:41:39.000Z | import sys
import yaml
from tqdm import tqdm
from datetime import datetime
import torch
from torch import tensor
from torchvision import transforms
from PIL import ImageFilter
from sklearn import random_projection
TQDM_PARAMS = {
"file" : sys.stdout,
"bar_format" : " {l_bar}{bar:10}{r_bar}{bar:-10b}",
}
def get... | 34.592308 | 104 | 0.624194 |
82939abff9d6594ebd4418defc5ed242f05ed765 | 9,660 | py | Python | doc/source/conf.py | andrejmuhic/cvxpy | 4877fe9e513cc0f9943d452740ccfb84552c2849 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-03-24T19:39:09.000Z | 2022-03-24T19:39:09.000Z | doc/source/conf.py | Shulu-Chen/cvxpy | d156d1e6efb562470312aef3468ab938bab32e6e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | doc/source/conf.py | Shulu-Chen/cvxpy | d156d1e6efb562470312aef3468ab938bab32e6e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# CVXPY documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 27 20:47:07 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 32.2 | 124 | 0.708075 |
5d25555d2c2e2bb724247d8455a9bf9cb28cff3c | 1,777 | py | Python | src/falconpy/_uber_default_preference.py | fcremer/falconpy | eb2b000f1a73553e355d7b685d2e1006a4975030 | [
"Unlicense"
] | null | null | null | src/falconpy/_uber_default_preference.py | fcremer/falconpy | eb2b000f1a73553e355d7b685d2e1006a4975030 | [
"Unlicense"
] | null | null | null | src/falconpy/_uber_default_preference.py | fcremer/falconpy | eb2b000f1a73553e355d7b685d2e1006a4975030 | [
"Unlicense"
] | null | null | null | """Internal constant library.
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | ... | 43.341463 | 71 | 0.676984 |
4cdc4d852d1ae917fd481a940803d7eed457dfec | 2,010 | py | Python | handyspark/sql/schema.py | FoundryAI/handyspark | bf23522eb0794cce8af2f036347b34df1a2c7b09 | [
"MIT"
] | null | null | null | handyspark/sql/schema.py | FoundryAI/handyspark | bf23522eb0794cce8af2f036347b34df1a2c7b09 | [
"MIT"
] | null | null | null | handyspark/sql/schema.py | FoundryAI/handyspark | bf23522eb0794cce8af2f036347b34df1a2c7b09 | [
"MIT"
] | null | null | null | import numpy as np
import datetime
from operator import itemgetter
from pyspark.sql.types import StructType
_mapping = {str: 'string',
bool: 'boolean',
int: 'integer',
float: 'float',
datetime.date: 'date',
datetime.datetime: 'timestamp',
np.bool:... | 32.419355 | 94 | 0.569652 |
d07eabae2ff8c8a7b084ae3d6a7e7266d747e87b | 489 | py | Python | relational/scripts/tests/context.py | snspam/sn_spam | e0bb8e9c843e26e5f4be8a49a960ebf7a0d5bfd5 | [
"MIT"
] | null | null | null | relational/scripts/tests/context.py | snspam/sn_spam | e0bb8e9c843e26e5f4be8a49a960ebf7a0d5bfd5 | [
"MIT"
] | null | null | null | relational/scripts/tests/context.py | snspam/sn_spam | e0bb8e9c843e26e5f4be8a49a960ebf7a0d5bfd5 | [
"MIT"
] | null | null | null | import os
import sys
one_level_up = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(1, one_level_up)
from app import config
from app.tests import test_utils
from relational.scripts import comments
from relational.scripts import generator
from relational.scripts import pred_builder
from r... | 30.5625 | 77 | 0.832311 |
bc7d7a40a19d7345bb6b03a4ae09743b23f5f28c | 19,341 | py | Python | selvbetjening/sadmin2/views/event.py | animekita/selvbetjening | fee63d178fbd5ce2976c04d3a4b2dde6d8691892 | [
"MIT"
] | null | null | null | selvbetjening/sadmin2/views/event.py | animekita/selvbetjening | fee63d178fbd5ce2976c04d3a4b2dde6d8691892 | [
"MIT"
] | 3 | 2020-02-11T21:54:59.000Z | 2021-06-10T17:35:21.000Z | selvbetjening/sadmin2/views/event.py | animekita/selvbetjening | fee63d178fbd5ce2976c04d3a4b2dde6d8691892 | [
"MIT"
] | null | null | null | # coding=utf-8
from django.contrib.admin.util import NestedObjects
from django.core.urlresolvers import reverse
from django.forms.models import modelformset_factory
from django.http.response import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.contrib import messages
from djan... | 34.414591 | 133 | 0.628664 |
96a17abf511133dd2ca08b4656825414b0dc1e0f | 196 | py | Python | django_priority_batch/__init__.py | dblenkus/django-priority-batch | 8cc051b1196e90ef3ccc9d14d1ea277d46e31891 | [
"Apache-2.0"
] | 1 | 2018-10-16T10:56:53.000Z | 2018-10-16T10:56:53.000Z | django_priority_batch/__init__.py | dblenkus/django-priority-batch | 8cc051b1196e90ef3ccc9d14d1ea277d46e31891 | [
"Apache-2.0"
] | 3 | 2018-10-19T10:42:01.000Z | 2018-10-21T10:14:56.000Z | django_priority_batch/__init__.py | dblenkus/django-priority-batch | 8cc051b1196e90ef3ccc9d14d1ea277d46e31891 | [
"Apache-2.0"
] | 4 | 2018-10-19T08:03:48.000Z | 2020-02-03T19:49:51.000Z | """.. Ignore pydocstyle D400.
=====================
Django Priority Batch
=====================
TODO.
"""
from .middleware import Middleware
from .prioritized_batcher import PrioritizedBatcher
| 16.333333 | 51 | 0.612245 |
c7bb2e222aa18ee2953c568fe8b4f4e70356e922 | 36,671 | py | Python | contentcuration/contentcuration/viewsets/contentnode.py | ozer550/studio | b69c625d223350b1b4a6909904ec4b44f80b211d | [
"MIT"
] | 6 | 2016-02-02T12:49:54.000Z | 2017-12-05T21:00:01.000Z | contentcuration/contentcuration/viewsets/contentnode.py | ozer550/studio | b69c625d223350b1b4a6909904ec4b44f80b211d | [
"MIT"
] | 195 | 2015-05-19T20:37:51.000Z | 2018-02-27T19:06:54.000Z | contentcuration/contentcuration/viewsets/contentnode.py | ozer550/studio | b69c625d223350b1b4a6909904ec4b44f80b211d | [
"MIT"
] | 33 | 2015-05-06T19:19:09.000Z | 2017-11-16T12:50:54.000Z | import json
from functools import partial
from functools import reduce
from django.conf import settings
from django.core.exceptions import ValidationError as DjangoValidationError
from django.db import IntegrityError
from django.db import models
from django.db.models import Exists
from django.db.models import F
from d... | 36.488557 | 127 | 0.6194 |
eebc522f722f37ea19f0e56f143d03a21d127824 | 449 | py | Python | recursive_algorithms/Tower of Hanoi/Python/tower_of_hanoi.py | avi-pal/al-go-rithms | 5167a20f1db7b366ff19f2962c1746a02e4f5067 | [
"CC0-1.0"
] | 1,253 | 2017-06-06T07:19:25.000Z | 2022-03-30T17:07:58.000Z | recursive_algorithms/Tower of Hanoi/Python/tower_of_hanoi.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 554 | 2017-09-29T18:56:01.000Z | 2022-02-21T15:48:13.000Z | recursive_algorithms/Tower of Hanoi/Python/tower_of_hanoi.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 2,226 | 2017-09-29T19:59:59.000Z | 2022-03-25T08:59:55.000Z | # Recursive Python function to solve tower of hanoi
def TowerOfHanoi(n , from_rod, to_rod, aux_rod):
if n == 1:
print("Move disk 1 from rod",from_rod,"to rod",to_rod)
return
TowerOfHanoi(n-1, from_rod, aux_rod, to_rod)
print("Move disk",n,"from rod",from_rod,"to rod",to_rod)
TowerOfHanoi(n-1, aux_rod, to_rod, ... | 26.411765 | 57 | 0.697105 |
d39d713ace8cee7c4098547ecc240d4a3d346cb2 | 17,220 | py | Python | automonkey/tcloud_update.py | wangshaoce/monkey_tcloud | 124f2a06caad2aeabdd1d8254d3fa2765c264d8e | [
"MIT"
] | null | null | null | automonkey/tcloud_update.py | wangshaoce/monkey_tcloud | 124f2a06caad2aeabdd1d8254d3fa2765c264d8e | [
"MIT"
] | null | null | null | automonkey/tcloud_update.py | wangshaoce/monkey_tcloud | 124f2a06caad2aeabdd1d8254d3fa2765c264d8e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import logging
import traceback
from datetime import datetime
import requests
from .config import DefaultConfig
logger = logging.getLogger(__name__)
class TCloud(object):
def __init__(self, task_id, device_id, monkey_id, tcloud_url, process=0):
self.task_id = task_i... | 43.705584 | 119 | 0.602207 |
e0c0e13c95aec028b9ef0d984171f6799fdcf2b7 | 466 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/radialaxis/_visible.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/radialaxis/_visible.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/radialaxis/_visible.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="visible", parent_name="layout.radialaxis", **kwargs
):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | 31.066667 | 78 | 0.639485 |
6dd552b7d50c6adea3820073ded82f03a55d964c | 2,210 | py | Python | mne/tests/test_morph_map.py | stevemats/mne-python | 47051833f21bb372d60afc3adbf4305648ac7f69 | [
"BSD-3-Clause"
] | 1 | 2022-02-19T08:13:49.000Z | 2022-02-19T08:13:49.000Z | mne/tests/test_morph_map.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | 2 | 2018-10-29T09:09:34.000Z | 2019-08-02T16:24:09.000Z | mne/tests/test_morph_map.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | 1 | 2021-07-22T17:57:33.000Z | 2021-07-22T17:57:33.000Z | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import os
import os.path as op
from shutil import copyfile
import pytest
import numpy as np
from numpy.testing import assert_allclose
from scipy import sparse
from mne.datasets import testing
from mne.utils import catch_logging, _r... | 36.229508 | 79 | 0.628959 |
8eb1b1b80043e61fe090fe4fdc9c1ce7fdbbecad | 408 | py | Python | rental/migrations/0026_auto_20191206_1217.py | rjNemo/villafleurie | 87e4674d5d7f26475b8debe300cbf4263dc18ebd | [
"MIT"
] | null | null | null | rental/migrations/0026_auto_20191206_1217.py | rjNemo/villafleurie | 87e4674d5d7f26475b8debe300cbf4263dc18ebd | [
"MIT"
] | 3 | 2020-03-06T18:45:44.000Z | 2020-07-31T11:47:52.000Z | rental/migrations/0026_auto_20191206_1217.py | rjNemo/villafleurie | 87e4674d5d7f26475b8debe300cbf4263dc18ebd | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2019-12-06 12:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rental', '0025_auto_20191206_1215'),
]
operations = [
migrations.AlterField(
model_name='place',
name='calendar',
... | 21.473684 | 74 | 0.607843 |
602c209f2e54793eb3d71c9cd40d0b11faf6a241 | 737 | py | Python | project/machine_learning_model/model_predict.py | wanwanjiajia/adversarial_attacks_defense | d22dbfa7de5c6af901dbd2ed26e7eb079bd0c215 | [
"BSD-2-Clause"
] | null | null | null | project/machine_learning_model/model_predict.py | wanwanjiajia/adversarial_attacks_defense | d22dbfa7de5c6af901dbd2ed26e7eb079bd0c215 | [
"BSD-2-Clause"
] | null | null | null | project/machine_learning_model/model_predict.py | wanwanjiajia/adversarial_attacks_defense | d22dbfa7de5c6af901dbd2ed26e7eb079bd0c215 | [
"BSD-2-Clause"
] | null | null | null | # _*_coding:utf-8 _*_
# @Time :2020/01/03 12:20
# @Author : Wanjia Zheng
# @File :model_predict.py
# @Software :PyCharm
from sklearn.model_selection import cross_validate
def model_predict(model, X_train_reduced, Y_train):
scores = cross_validate(model, X_train_reduced, Y_train.ravel(), cv=10,
... | 32.043478 | 104 | 0.624152 |
d2da4cc3de17b7d9d98ae81089c7de186f7d3236 | 5,762 | py | Python | tests/usecases/list_permissions_test.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 58 | 2017-05-26T06:46:24.000Z | 2022-03-25T20:55:51.000Z | tests/usecases/list_permissions_test.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 74 | 2017-06-16T17:48:37.000Z | 2022-03-28T23:09:54.000Z | tests/usecases/list_permissions_test.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 43 | 2017-05-20T22:11:51.000Z | 2022-03-25T00:24:56.000Z | from dataclasses import replace
from datetime import datetime
from time import time
from typing import TYPE_CHECKING
from grouper.constants import PERMISSION_CREATE
from grouper.entities.pagination import ListPermissionsSortKey, PaginatedList, Pagination
from grouper.entities.permission import Permission
from grouper.... | 38.932432 | 99 | 0.708608 |
078b16eab822167b11ee1375c530f09a25c35580 | 986 | py | Python | gpypi/exc.py | tastuteche/g-pypi-py3 | ea0fceb573415193993f2a03bd06a9fffa755892 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-03-02T02:20:43.000Z | 2015-03-02T02:20:43.000Z | gpypi/exc.py | iElectric/g-pypi | 48b1d83346fecbba4c3eb3a7f80d29ae9ca41ef8 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | gpypi/exc.py | iElectric/g-pypi | 48b1d83346fecbba4c3eb3a7f80d29ae9ca41ef8 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Exceptions module
=============================
"""
class GPyPiException(Exception):
"""Core exception class, all exception inherit from this class."""
class GPyPiInvalidAtom(GPyPiException):
"""Raised when determining Portage Atom did not succeed."""
cla... | 20.541667 | 70 | 0.700811 |
b56d2092b9905ad4e741a2b1c1355d3a376e0be9 | 1,763 | py | Python | roles/openshift_health_checker/openshift_checks/etcd_traffic.py | Roscoe198/Ansible-Openshift | b874bef456852ef082a27dfec4f2d7d466702370 | [
"Apache-2.0"
] | 164 | 2015-07-29T17:35:04.000Z | 2021-12-16T16:38:04.000Z | roles/openshift_health_checker/openshift_checks/etcd_traffic.py | Roscoe198/Ansible-Openshift | b874bef456852ef082a27dfec4f2d7d466702370 | [
"Apache-2.0"
] | 3,634 | 2015-06-09T13:49:15.000Z | 2022-03-23T20:55:44.000Z | roles/openshift_health_checker/openshift_checks/etcd_traffic.py | Roscoe198/Ansible-Openshift | b874bef456852ef082a27dfec4f2d7d466702370 | [
"Apache-2.0"
] | 250 | 2015-06-08T19:53:11.000Z | 2022-03-01T04:51:23.000Z | """Check that scans journalctl for messages caused as a symptom of increased etcd traffic."""
from openshift_checks import OpenShiftCheck
class EtcdTraffic(OpenShiftCheck):
"""Check if host is being affected by an increase in etcd traffic."""
name = "etcd_traffic"
tags = ["health", "etcd"]
def is_a... | 39.177778 | 103 | 0.636982 |
562a70c5b0d93d7ebc36844ed5d177bbfa375c54 | 292 | py | Python | glosel/glosel/doctype/scheme_management_item/scheme_management_item.py | patilsangram/Glosel | 12b00f7821e63056ef0e4e34e64f2906f927e273 | [
"MIT"
] | null | null | null | glosel/glosel/doctype/scheme_management_item/scheme_management_item.py | patilsangram/Glosel | 12b00f7821e63056ef0e4e34e64f2906f927e273 | [
"MIT"
] | null | null | null | glosel/glosel/doctype/scheme_management_item/scheme_management_item.py | patilsangram/Glosel | 12b00f7821e63056ef0e4e34e64f2906f927e273 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, New Indictrans Technologies PVT LTD and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class SchemeManagementItem(Document):
pass
| 26.545455 | 74 | 0.794521 |
5582b7d97200517901b0a025b0d58fcb97a3b3bc | 192 | py | Python | fastemplate/objects/user.py | htbrandao/fastemplate | 239784538e1dd7ea8a6d5105cb9cb27b1d7f53cb | [
"MIT"
] | 8 | 2021-07-28T13:18:02.000Z | 2022-02-05T23:10:02.000Z | fastemplate/objects/user.py | htbrandao/fastemplate | 239784538e1dd7ea8a6d5105cb9cb27b1d7f53cb | [
"MIT"
] | null | null | null | fastemplate/objects/user.py | htbrandao/fastemplate | 239784538e1dd7ea8a6d5105cb9cb27b1d7f53cb | [
"MIT"
] | null | null | null | from dataclasses import dataclass
@dataclass
class User:
"""
Schema to represent a user when dealing with authentication.
"""
username: str
full_name: str
owner: bool
| 17.454545 | 64 | 0.682292 |
11e601abe0317adc8258604c8f9c2f89f9f2afb8 | 1,170 | py | Python | sympy/utilities/tests/test_matchpy_connector.py | Nisarg-Chaudhari/sympy | c9dbb014993f6248be0a4a3d514545cbf7d4c1c1 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/tests/test_matchpy_connector.py | Nisarg-Chaudhari/sympy | c9dbb014993f6248be0a4a3d514545cbf7d4c1c1 | [
"BSD-3-Clause"
] | null | null | null | sympy/utilities/tests/test_matchpy_connector.py | Nisarg-Chaudhari/sympy | c9dbb014993f6248be0a4a3d514545cbf7d4c1c1 | [
"BSD-3-Clause"
] | null | null | null | from sympy import symbols
from sympy.external import import_module
from sympy.utilities.matchpy_connector import WildDot, WildPlus, WildStar
matchpy = import_module("matchpy")
x, y, z = symbols("x y z")
def _get_first_match(expr, pattern):
from matchpy import ManyToOneMatcher, Pattern
matcher = ManyToOneMa... | 25.434783 | 73 | 0.659829 |
23285da38c07efcc690eeed03f9fdff7659cd463 | 622 | py | Python | var/spack/repos/builtin/packages/py-rdflib-jsonld/package.py | MatMaul/spack | 46c56c163cd0b437c96492b0fa1f3d4bbc4fb492 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-rdflib-jsonld/package.py | MatMaul/spack | 46c56c163cd0b437c96492b0fa1f3d4bbc4fb492 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-rdflib-jsonld/package.py | MatMaul/spack | 46c56c163cd0b437c96492b0fa1f3d4bbc4fb492 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2018 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 PyRdflibJsonld(PythonPackage):
"""RDFLib plugin providing JSON-LD parsing and serializatio... | 31.1 | 91 | 0.723473 |
d12f92fa7d7f5287242a896c1fa9406c7079ad3b | 588 | py | Python | deftools/printerator.py | tobias-fyi/deftools | 3389ff2cc02fb36732d8f0bff71267cc5a6fd6ad | [
"MIT"
] | 3 | 2020-02-06T16:35:11.000Z | 2020-02-29T09:31:55.000Z | deftools/printerator.py | tobias-fyi/deftools | 3389ff2cc02fb36732d8f0bff71267cc5a6fd6ad | [
"MIT"
] | 82 | 2020-01-29T23:48:32.000Z | 2021-09-08T02:09:30.000Z | deftools/printerator.py | tobias-fyi/deftools | 3389ff2cc02fb36732d8f0bff71267cc5a6fd6ad | [
"MIT"
] | 10 | 2020-02-20T16:59:19.000Z | 2020-05-28T15:27:13.000Z | """Generator-based script to build a dataset from a filesystem."""
import os
class FileReader:
"""Base class for reading through a file system."""
def __init__(self, src, valid_exts=(".jpg", ".jpeg", ".png")):
self.src = src
self.valid_exts = valid_exts
def file_printer(self):
f... | 21.777778 | 66 | 0.641156 |
ad0a6c82f832c5a7fb241a2b9eed05ad1b0a6983 | 13,750 | py | Python | var/spack/repos/builtin/packages/openblas/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/openblas/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2022-03-09T09:15:39.000Z | 2022-03-09T09:15:42.000Z | var/spack/repos/builtin/packages/openblas/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-01-05T20:00:52.000Z | 2021-01-05T20:00:52.000Z | # Copyright 2013-2020 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)
import os
import re
from spack import *
from spack.package_test import compare_output_file, compile_c_and_execute
class... | 43.238994 | 116 | 0.655636 |
b42568f99316032f0a799faf900b09ad7a192e26 | 40 | py | Python | tests/delete_deployment_test.py | BIX-Digital/mlflow-openshift | 1909191503ec2071d6f1f4e79cd859e7d7ad15e2 | [
"Apache-2.0"
] | 4 | 2021-01-06T07:49:21.000Z | 2021-11-30T13:49:50.000Z | tests/delete_deployment_test.py | pille321/mlflow-openshift | 0450a9ca7ae25dcd462324c41cccc894d40b7be5 | [
"Apache-2.0"
] | 2 | 2021-02-27T10:10:27.000Z | 2022-02-08T08:13:50.000Z | tests/delete_deployment_test.py | pille321/mlflow-openshift | 0450a9ca7ae25dcd462324c41cccc894d40b7be5 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:22:16.000Z | 2021-01-11T06:22:16.000Z | # TODO: check if it is really gone
pass
| 13.333333 | 34 | 0.725 |
5c5a5f32f22ff496dd984ad17aeb475bb6bc47ab | 16,858 | py | Python | src/cltk/phonology/syllabify.py | clemsciences/cltkv1 | 88bd45419e254f69c9467ce6b2543249c57d1503 | [
"MIT"
] | 2 | 2019-08-18T21:10:01.000Z | 2020-05-05T09:19:40.000Z | src/cltk/phonology/syllabify.py | clemsciences/cltkv1 | 88bd45419e254f69c9467ce6b2543249c57d1503 | [
"MIT"
] | 62 | 2019-02-01T18:48:11.000Z | 2020-08-19T17:52:53.000Z | src/cltk/phonology/syllabify.py | clemsciences/cltkv1 | 88bd45419e254f69c9467ce6b2543249c57d1503 | [
"MIT"
] | 8 | 2019-04-07T03:47:31.000Z | 2020-07-01T07:02:59.000Z | import logging
import unicodedata
from collections import defaultdict
from typing import List
from cltk.core.exceptions import CLTKException
from cltk.phonology.middle_english.syllabifier import Syllabifier as ME_Syllabifier
from cltk.phonology.middle_high_german.syllabifier import Syllabifier as MHG_Syllabifier
from ... | 33.581673 | 300 | 0.541049 |
8c1d50425b9bf4df2bd89324c89706a11647b9df | 168 | py | Python | setup.py | fracek/cairo-dap | 6df0c4e56ca613b24b33ad8851ee7b27f650a4d8 | [
"Apache-2.0"
] | 4 | 2021-05-13T08:17:23.000Z | 2022-02-22T18:13:30.000Z | setup.py | fracek/cairo-dap | 6df0c4e56ca613b24b33ad8851ee7b27f650a4d8 | [
"Apache-2.0"
] | null | null | null | setup.py | fracek/cairo-dap | 6df0c4e56ca613b24b33ad8851ee7b27f650a4d8 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='cairo_dap',
entry_points={
'console_scripts': [
'cairo-dap=cairo_dap.cli:main'
]
}
) | 15.272727 | 42 | 0.559524 |
a7c078d0060928b15e5d2fa7606245c556e528ed | 58,907 | py | Python | superset/connectors/sqla/models.py | venter-zhu/incubator-superset | 329e72885c20d3a36f70dbe2909c4665f51ec92f | [
"Apache-2.0"
] | 1 | 2020-11-05T11:16:15.000Z | 2020-11-05T11:16:15.000Z | superset/connectors/sqla/models.py | venter-zhu/incubator-superset | 329e72885c20d3a36f70dbe2909c4665f51ec92f | [
"Apache-2.0"
] | 38 | 2020-11-23T22:26:13.000Z | 2022-02-17T07:39:23.000Z | superset/connectors/sqla/models.py | venter-zhu/incubator-superset | 329e72885c20d3a36f70dbe2909c4665f51ec92f | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.353836 | 115 | 0.59122 |
b7a3746496724c9221bfa73a8eeda4576eadc965 | 5,253 | py | Python | numpyro/_downloads/1290c9ac531016f80fb7c5656adffcb4/bnn.py | fehiepsi/website | 7b0165deebc1379105d8b9d8051187f7d9914446 | [
"MIT"
] | null | null | null | numpyro/_downloads/1290c9ac531016f80fb7c5656adffcb4/bnn.py | fehiepsi/website | 7b0165deebc1379105d8b9d8051187f7d9914446 | [
"MIT"
] | null | null | null | numpyro/_downloads/1290c9ac531016f80fb7c5656adffcb4/bnn.py | fehiepsi/website | 7b0165deebc1379105d8b9d8051187f7d9914446 | [
"MIT"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
Bayesian Neural Network
=======================
We demonstrate how to use NUTS to do inference on a simple (small)
Bayesian neural network with two hidden layers.
"""
import argparse
import os
import time
import matplotlib
impor... | 34.333333 | 106 | 0.667238 |
c1f52524d1750111d36361ad53c7d81382167865 | 42,473 | py | Python | workers/pull_request_worker/pull_request_worker/worker.py | ishagarg06/augur | 2295d48288d243c9ac01bf54ba140ca756828929 | [
"MIT"
] | null | null | null | workers/pull_request_worker/pull_request_worker/worker.py | ishagarg06/augur | 2295d48288d243c9ac01bf54ba140ca756828929 | [
"MIT"
] | null | null | null | workers/pull_request_worker/pull_request_worker/worker.py | ishagarg06/augur | 2295d48288d243c9ac01bf54ba140ca756828929 | [
"MIT"
] | null | null | null | import ast, json, logging, os, sys, time, traceback, requests
from datetime import datetime
from multiprocessing import Process, Queue
from urllib.parse import urlparse
import pandas as pd
import sqlalchemy as s
from sqlalchemy import MetaData
from sqlalchemy.ext.automap import automap_base
from workers.standard_method... | 43.251527 | 182 | 0.582229 |
8e3fc2eb9bacb6a3359adbddbe61138706362f9d | 16,923 | py | Python | src/bdbdatastore/src/google/protobuf/descriptor.py | sprymak/typhoonae | fe31bcc7b21fc14f8aa97b36d66cd7671974543b | [
"Apache-2.0"
] | 3 | 2015-12-23T14:26:05.000Z | 2016-05-09T04:05:51.000Z | third_party/google/protobuf/descriptor.py | dewitt/webfingerclient-dclinton | c13990378c8b0516c84f8507664e0a6ab8eefac5 | [
"Apache-2.0"
] | 1 | 2016-12-15T12:24:46.000Z | 2016-12-15T12:24:46.000Z | third_party/google/protobuf/descriptor.py | dewitt/webfingerclient-dclinton | c13990378c8b0516c84f8507664e0a6ab8eefac5 | [
"Apache-2.0"
] | 1 | 2018-12-02T10:36:08.000Z | 2018-12-02T10:36:08.000Z | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | 38.993088 | 80 | 0.715181 |
b7d185a1dfcdb88c8199b3e33c7778ff91a262a7 | 4,592 | py | Python | preferences/views.py | jbbqqf/okapi | 3db29ef1e15685fae304190bd176f75c4e367d03 | [
"BSD-3-Clause"
] | null | null | null | preferences/views.py | jbbqqf/okapi | 3db29ef1e15685fae304190bd176f75c4e367d03 | [
"BSD-3-Clause"
] | null | null | null | preferences/views.py | jbbqqf/okapi | 3db29ef1e15685fae304190bd176f75c4e367d03 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import IntegrityError
from rest_framework import status
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import (
ListModelMixin, RetrieveModelMixin, UpdateModelMixin, DestroyModelMixin)
from rest_fram... | 34.787879 | 79 | 0.686847 |
eb124fe3c01c46356a4c028f455c7890eae636a5 | 16,954 | py | Python | GBM/GBMSlidingwindows_V2/GBMslidingwindow_LabelT1window.py | joshlyman/TextureAnalysis | bfbedbd53f62396fdef383408089b37e5ab511d0 | [
"MIT"
] | 1 | 2020-07-06T01:47:49.000Z | 2020-07-06T01:47:49.000Z | GBM/GBMSlidingwindows_V2/GBMslidingwindow_LabelT1window.py | kumarneeraj2005/TextureAnalysis | bfbedbd53f62396fdef383408089b37e5ab511d0 | [
"MIT"
] | null | null | null | GBM/GBMSlidingwindows_V2/GBMslidingwindow_LabelT1window.py | kumarneeraj2005/TextureAnalysis | bfbedbd53f62396fdef383408089b37e5ab511d0 | [
"MIT"
] | 1 | 2020-06-22T08:26:10.000Z | 2020-06-22T08:26:10.000Z | # 2nd version: GBM sliding window for all 6 contrast images and also
# do T2 sliding windows: Label windows which are also belong to T1 windows
# Recently update 0821: change the raw mean setting from 8*8 box normalization
# to raw feature w/o any normalization
# add PI and Necrosis are in another files: Add_PI_GBMS... | 36.776573 | 169 | 0.57538 |
e7061eb7d2c1926d914ec648246fb721e8d11e39 | 546 | py | Python | image_library/db_setup.py | gustavoschaedler/cc-anchorloans | 946387cc1966ebbff3c0b6e05aaf477e6572db16 | [
"MIT"
] | null | null | null | image_library/db_setup.py | gustavoschaedler/cc-anchorloans | 946387cc1966ebbff3c0b6e05aaf477e6572db16 | [
"MIT"
] | 4 | 2021-03-19T03:13:34.000Z | 2022-01-13T01:34:26.000Z | image_library/db_setup.py | gustavoschaedler/cc-anchorloans | 946387cc1966ebbff3c0b6e05aaf477e6572db16 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('sqlite:///site.db', convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=False,
auto... | 34.125 | 65 | 0.690476 |
029e3f99a84ae86365e7e55b32e3c14291ecf68d | 4,918 | py | Python | src/keycloak/admin/roles.py | Arhimed/python-keycloak-client | 37f09681b7c1ea9265885e30ba138382978b031e | [
"MIT"
] | null | null | null | src/keycloak/admin/roles.py | Arhimed/python-keycloak-client | 37f09681b7c1ea9265885e30ba138382978b031e | [
"MIT"
] | null | null | null | src/keycloak/admin/roles.py | Arhimed/python-keycloak-client | 37f09681b7c1ea9265885e30ba138382978b031e | [
"MIT"
] | null | null | null | import json
from collections import OrderedDict
from keycloak.admin import KeycloakAdminCollection, KeycloakAdminBaseElement
from keycloak.helpers import to_camel_case
ROLE_KWARGS = [
'description',
'id',
'client_role',
'composite',
'composites',
'container_id',
'scope_param_required'
]
__... | 28.929412 | 115 | 0.631151 |
15e922ac3d9089dc475cdba6468645bed6cfd50b | 1,065 | py | Python | official/nlp/projects/mobilebert/utils.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | 1 | 2021-05-22T12:50:50.000Z | 2021-05-22T12:50:50.000Z | official/nlp/projects/mobilebert/utils.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | official/nlp/projects/mobilebert/utils.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 35.5 | 76 | 0.723005 |
ba422f0923a5b8928768a3df3097193dc0c47e92 | 63,539 | py | Python | lib/spack/spack/test/cmd/ci.py | dialvarezs/spack | 14d4203722daf3abd56a2b6c880214a1338e289f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/test/cmd/ci.py | dialvarezs/spack | 14d4203722daf3abd56a2b6c880214a1338e289f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/test/cmd/ci.py | dialvarezs/spack | 14d4203722daf3abd56a2b6c880214a1338e289f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 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)
import filecmp
import json
import os
import shutil
import sys
import pytest
from jsonschema import ValidationError, valid... | 34.873216 | 85 | 0.571255 |
ed7c50de42e9efa1c42a0490890312e9e5f6cd20 | 1,983 | py | Python | tests/test_read_simple_rmd.py | vmarceau/jupytext | 799ea65b693a5f387fe37c9aebad463a97d1dd38 | [
"MIT"
] | null | null | null | tests/test_read_simple_rmd.py | vmarceau/jupytext | 799ea65b693a5f387fe37c9aebad463a97d1dd38 | [
"MIT"
] | null | null | null | tests/test_read_simple_rmd.py | vmarceau/jupytext | 799ea65b693a5f387fe37c9aebad463a97d1dd38 | [
"MIT"
] | 1 | 2021-07-02T17:49:27.000Z | 2021-07-02T17:49:27.000Z | import re
from jupytext.compare import compare
import jupytext
from .utils import skip_if_dict_is_not_ordered
@skip_if_dict_is_not_ordered
def test_read_mostly_py_rmd_file(rmd="""---
title: Simple file
---
```{python, echo=TRUE}
import numpy as np
x = np.arange(0, 2*math.pi, eps)
```
```{python, echo=TRUE}
x = np.a... | 32.508197 | 78 | 0.415532 |
4ca3b4f6233000a51671fb1860b4423e15ccaf05 | 4,164 | py | Python | dvc/cache.py | gyliu513/dvc | d932405ee148767c5dbbbc394d6cd414270bf8f0 | [
"Apache-2.0"
] | 1 | 2020-01-31T14:29:20.000Z | 2020-01-31T14:29:20.000Z | dvc/cache.py | gyliu513/dvc | d932405ee148767c5dbbbc394d6cd414270bf8f0 | [
"Apache-2.0"
] | null | null | null | dvc/cache.py | gyliu513/dvc | d932405ee148767c5dbbbc394d6cd414270bf8f0 | [
"Apache-2.0"
] | null | null | null | """Manages cache of a dvc repo."""
from __future__ import unicode_literals
import os
from collections import defaultdict
from funcy import cached_property
from dvc.utils.compat import builtin_str
from dvc.config import Config
class CacheConfig(object):
def __init__(self, config):
self.config = config
... | 29.742857 | 79 | 0.635927 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.