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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f9dc64cdcccda73216157e17dba871e675d94dc0 | 6,167 | py | Python | src/tkinterface.py | josepmartorell/IBAN_Checker | 6c5cb67cf695b3add0e80a70ced0985dae2288f4 | [
"MIT"
] | null | null | null | src/tkinterface.py | josepmartorell/IBAN_Checker | 6c5cb67cf695b3add0e80a70ced0985dae2288f4 | [
"MIT"
] | 2 | 2019-07-08T12:31:31.000Z | 2019-07-17T18:13:25.000Z | src/tkinterface.py | josepmartorell/IBAN_Checker | 6c5cb67cf695b3add0e80a70ced0985dae2288f4 | [
"MIT"
] | 1 | 2021-03-26T06:46:47.000Z | 2021-03-26T06:46:47.000Z | import tkinter as tkk
import json
from src import cli
with open('iban.json', 'r') as json_file:
data = json.load(json_file)
class Application(tkk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.check = tkk.Button(self)
self.exit = tk... | 31.464286 | 117 | 0.496514 |
4cbb8d432f123c0fa710d052603525ae0dd8c097 | 15,198 | py | Python | sisua/data/utils.py | trungnt13/sisua | 27c01002aaac5b33947946a483bfb6678273bc83 | [
"MIT"
] | 18 | 2019-05-09T14:48:53.000Z | 2021-07-05T16:23:58.000Z | sisua/data/utils.py | trungnt13/sisua | 27c01002aaac5b33947946a483bfb6678273bc83 | [
"MIT"
] | 1 | 2020-04-03T03:28:58.000Z | 2020-07-02T13:43:02.000Z | sisua/data/utils.py | trungnt13/sisua | 27c01002aaac5b33947946a483bfb6678273bc83 | [
"MIT"
] | 3 | 2021-02-23T07:40:42.000Z | 2021-09-14T09:36:28.000Z | from __future__ import absolute_import, division, print_function
import base64
import gzip
import os
import pickle
import shutil
import tarfile
import warnings
import zipfile
from contextlib import contextmanager
from copy import deepcopy
from urllib.request import urlretrieve
import numpy as np
from scipy import spa... | 33.549669 | 110 | 0.591723 |
1d74b0ba7ba8168d55826a0b3cef00190f18b826 | 1,643 | py | Python | setup.py | m-yuhas/pyrainboweffect | 2382913599e775090f621a88dd184107711f2ab6 | [
"MIT"
] | null | null | null | setup.py | m-yuhas/pyrainboweffect | 2382913599e775090f621a88dd184107711f2ab6 | [
"MIT"
] | null | null | null | setup.py | m-yuhas/pyrainboweffect | 2382913599e775090f621a88dd184107711f2ab6 | [
"MIT"
] | null | null | null | """Setup script for the pyrainboweffect package."""
from os import path
from setuptools import setup
LONG_DESCRIPTION = ''
with open(
path.join(
path.abspath(
path.dirname(__file__)), 'README.md'), encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
setup(
name='pyrainb... | 34.229167 | 78 | 0.615338 |
f31e1ea2c2c2ce41ffdb2584888b9f4b470e239d | 206 | py | Python | Server/Python/src/dbs/dao/MySQL/ProcessingEra/Insert.py | vkuznet/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 8 | 2015-08-14T04:01:32.000Z | 2021-06-03T00:56:42.000Z | Server/Python/src/dbs/dao/MySQL/ProcessingEra/Insert.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 162 | 2015-01-07T21:34:47.000Z | 2021-10-13T09:42:41.000Z | Server/Python/src/dbs/dao/MySQL/ProcessingEra/Insert.py | yuyiguo/DBS | 14df8bbe8ee8f874fe423399b18afef911fe78c7 | [
"Apache-2.0"
] | 16 | 2015-01-22T15:27:29.000Z | 2021-04-28T09:23:28.000Z | #!/usr/bin/env python
""" DAO Object for ProcessingEras table """
from dbs.dao.Oracle.ProcessingEra.Insert import Insert as OraProcessingEraInsert
class Insert(OraProcessingEraInsert):
pass
| 22.888889 | 80 | 0.747573 |
011a66dce41cd1a50227a53f4614b7c626f50a48 | 126,588 | py | Python | google/cloud/securitycenter_v1/services/security_center/async_client.py | googleapis/python-securitycenter | 1689fc9ff8ba6799ff3a3c6858fade769e06ca32 | [
"Apache-2.0"
] | 18 | 2020-09-19T09:56:27.000Z | 2022-03-23T10:36:40.000Z | google/cloud/securitycenter_v1/services/security_center/async_client.py | googleapis/python-securitycenter | 1689fc9ff8ba6799ff3a3c6858fade769e06ca32 | [
"Apache-2.0"
] | 111 | 2020-02-04T00:49:52.000Z | 2022-03-31T23:08:20.000Z | google/cloud/securitycenter_v1/services/security_center/async_client.py | googleapis/python-securitycenter | 1689fc9ff8ba6799ff3a3c6858fade769e06ca32 | [
"Apache-2.0"
] | 14 | 2020-02-07T19:43:38.000Z | 2022-01-29T08:13:26.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 42.027888 | 140 | 0.607119 |
603ed0f6d919442962e595f2d2b5bbdb2a4f916a | 438 | py | Python | pyspeedup/algorithms/_gcd.py | cdusold/PySpeedup | 2f31eb215971d546d45eb0376a4dd393698b625f | [
"MIT"
] | null | null | null | pyspeedup/algorithms/_gcd.py | cdusold/PySpeedup | 2f31eb215971d546d45eb0376a4dd393698b625f | [
"MIT"
] | 3 | 2015-06-03T21:27:59.000Z | 2015-07-11T06:37:38.000Z | pyspeedup/algorithms/_gcd.py | cdusold/PySpeedup | 2f31eb215971d546d45eb0376a4dd393698b625f | [
"MIT"
] | null | null | null | from pyspeedup import concurrent
@concurrent.Cache
def gcd(a,b):
'''Using the extended Euclidean algorithm, finds the gcd between a and b.
For example::
>>> gcd(5,10)
5
>>> gcd(1024,768)
256
>>> gcd(1474038573,183508437983)
1
'''
r=a%b
if r==0:
... | 16.222222 | 77 | 0.545662 |
335ac08809ff1de0bb1427279818feacafb27b34 | 596 | py | Python | dicom2rawiv/file_convert/runtest.py | chipbuster/skull-atlas | 7f3ee009e1d5f65f101fe853a2cf6e12662970ee | [
"BSD-3-Clause"
] | null | null | null | dicom2rawiv/file_convert/runtest.py | chipbuster/skull-atlas | 7f3ee009e1d5f65f101fe853a2cf6e12662970ee | [
"BSD-3-Clause"
] | null | null | null | dicom2rawiv/file_convert/runtest.py | chipbuster/skull-atlas | 7f3ee009e1d5f65f101fe853a2cf6e12662970ee | [
"BSD-3-Clause"
] | null | null | null | from slices2rawiv import *
from rawivutil import *
import dicomutil
import dicom
path = '/home/chipbuster/CVC/dataskulls/Females/Caucasian/14 years 7-12 months/7633464/DICOMUNC'
print("Reading and binning files...")
files = read_all_dicom_in_dirpath(path)
binned = sep_into_bins(files)
print("Done!")
count=1
for s... | 20.551724 | 96 | 0.686242 |
863a2c080d6078eb5d002c6a92d5699017a28a0e | 76,155 | py | Python | src/sage/rings/valuation/augmented_valuation.py | sheerluck/sage | b5e572b7d231f70c139d9978d68add80c4ef353d | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/rings/valuation/augmented_valuation.py | sheerluck/sage | b5e572b7d231f70c139d9978d68add80c4ef353d | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/rings/valuation/augmented_valuation.py | sheerluck/sage | b5e572b7d231f70c139d9978d68add80c4ef353d | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | # -*- coding: utf-8 -*-
r"""
Augmented valuations on polynomial rings
Implements augmentations of (inductive) valuations.
AUTHORS:
- Julian Rüth (2013-04-15): initial version
EXAMPLES:
Starting from a :mod:`Gauss valuation <sage.rings.valuation.gauss_valuation>`, we can create augmented valuations on
polynomial ri... | 35.240629 | 230 | 0.564388 |
6cf6eeb376394161e77418985a54fd0857ae330b | 3,337 | py | Python | couchbase_utils/cb_tools/cb_cli.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | couchbase_utils/cb_tools/cb_cli.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | couchbase_utils/cb_tools/cb_cli.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | from BucketLib.bucket import Bucket
from cb_tools.cb_tools_base import CbCmdBase
class CbCli(CbCmdBase):
def __init__(self, shell_conn, username="Administrator",
password="password"):
CbCmdBase.__init__(self, shell_conn, "couchbase-cli",
username=username, passw... | 38.802326 | 78 | 0.537309 |
c23ba0d000ba2887101da86d7146bf97c287a09d | 17,526 | py | Python | Model Development/Production.py | Letris/Thesis | 1b09fe08d8415034178c3a9d6a9b1ef733e3ef91 | [
"MIT"
] | null | null | null | Model Development/Production.py | Letris/Thesis | 1b09fe08d8415034178c3a9d6a9b1ef733e3ef91 | [
"MIT"
] | null | null | null | Model Development/Production.py | Letris/Thesis | 1b09fe08d8415034178c3a9d6a9b1ef733e3ef91 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sysconfig
from functools import partial
from pickle import load
from tkinter import *
from tkinter.filedialog import askopenfile, askopenfilename
from typing import NoReturn
import matplotlib.pyplot as plt
import pandas as pd
import shap
from PIL import Image, ImageTk
fro... | 44.36962 | 127 | 0.60687 |
7ce0db586eaa8802bc8a0a888b74118e435c897e | 951 | py | Python | PhysicsTools/PatAlgos/python/selectionLayer1/lowPtElectronSelector_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | PhysicsTools/PatAlgos/python/selectionLayer1/lowPtElectronSelector_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | PhysicsTools/PatAlgos/python/selectionLayer1/lowPtElectronSelector_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
# module to select Electrons
# See https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePhysicsCutParser
# on how to use the cut-string
#
selectedPatLowPtElectrons = cms.EDFilter("PATElectronSelector",
src = cms.InputTag("patLowPtElectrons"),
cut = cms.string("pt > 1. && ele... | 43.227273 | 89 | 0.70347 |
a8be429db835a50853474bed04425b13e40969e5 | 5,827 | py | Python | zerorobot/cli/server.py | threefoldtech/0-robot | 80b9912b77782a0d2277cbfa98cc672a5ef1e88e | [
"Apache-2.0"
] | null | null | null | zerorobot/cli/server.py | threefoldtech/0-robot | 80b9912b77782a0d2277cbfa98cc672a5ef1e88e | [
"Apache-2.0"
] | 63 | 2018-08-01T13:38:44.000Z | 2019-12-09T09:31:31.000Z | zerorobot/cli/server.py | threefoldtech/0-robot | 80b9912b77782a0d2277cbfa98cc672a5ef1e88e | [
"Apache-2.0"
] | null | null | null |
from gevent import monkey
# need to patch sockets to make requests async
monkey.patch_all(subprocess=False)
from jumpscale import j
import click
import logging
from Jumpscale.logging.Handlers import TelegramHandler
from Jumpscale.logging.Handlers import TelegramFormatter
from zerorobot.robot import Robot
telegram_... | 45.523438 | 191 | 0.71941 |
8494882c5b7c5fa616ed2fc1d28511cf64f04cff | 17,659 | py | Python | tests/shapes/test_base.py | just4jc/python-pptx | ec433085d84d48b5539c379e52eb3c279ab2cbc0 | [
"MIT"
] | 1 | 2016-06-07T17:12:37.000Z | 2016-06-07T17:12:37.000Z | tests/shapes/test_base.py | just4jc/python-pptx | ec433085d84d48b5539c379e52eb3c279ab2cbc0 | [
"MIT"
] | null | null | null | tests/shapes/test_base.py | just4jc/python-pptx | ec433085d84d48b5539c379e52eb3c279ab2cbc0 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
Test suite for pptx.shapes.shape module
"""
from __future__ import absolute_import
import pytest
from pptx.action import ActionSetting
from pptx.enum.shapes import PP_PLACEHOLDER
from pptx.oxml.shapes.shared import BaseShapeElement
from pptx.oxml.text import CT_TextBody
from pptx.shapes import... | 35.107356 | 77 | 0.623478 |
6f442963e684aba2a2ec2c66ac4732c7a95b6e6e | 8,723 | py | Python | signature_code/get_input_simclone1000.py | judithabk6/Clonesig_analysis | b473425833a75a6699b3b5b3026d91d00dbb53ba | [
"CC-BY-4.0"
] | 3 | 2021-09-13T08:41:34.000Z | 2022-02-09T09:51:58.000Z | signature_code/get_input_simclone1000.py | judithabk6/Clonesig_analysis | b473425833a75a6699b3b5b3026d91d00dbb53ba | [
"CC-BY-4.0"
] | null | null | null | signature_code/get_input_simclone1000.py | judithabk6/Clonesig_analysis | b473425833a75a6699b3b5b3026d91d00dbb53ba | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import pandas as pd
import numpy as np
import pkg_resources
from clonesig import mixin_init_parameters
from clonesig.data_loader import DataWriter
from scipy.spatial.distance import cosine
import pathlib
import sys
THRESHOLD = 0.05
samplename = sys.argv[1]
samplenumber = ... | 47.666667 | 289 | 0.654706 |
82966be630518ec656b271ce10c7536cac0c24c0 | 8,378 | py | Python | examples/gym/train_dqn_gym.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | 18 | 2018-08-07T07:27:41.000Z | 2018-08-20T01:51:21.000Z | examples/gym/train_dqn_gym.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | null | null | null | examples/gym/train_dqn_gym.py | yuishihara/chainerrl | 74901712a8ed8207b9d526d3f45b04bf22996b8d | [
"MIT"
] | 2 | 2018-08-16T06:47:26.000Z | 2018-08-20T01:51:22.000Z | """An example of training DQN against OpenAI Gym Envs.
This script is an example of training a DQN agent against OpenAI Gym envs.
Both discrete and continuous action spaces are supported. For continuous action
spaces, A NAF (Normalized Advantage Function) is used to approximate Q-values.
To solve CartPole-v0, run:
... | 40.278846 | 79 | 0.675698 |
043245c193b52935b4c64af1d3617ba0ebb158d2 | 285 | py | Python | Glaskugel/Glaskugel.py | DerHulk/Glaskugel | e7b892bf34d6fc7a42a31600fec34cf59b08fe87 | [
"MIT"
] | null | null | null | Glaskugel/Glaskugel.py | DerHulk/Glaskugel | e7b892bf34d6fc7a42a31600fec34cf59b08fe87 | [
"MIT"
] | null | null | null | Glaskugel/Glaskugel.py | DerHulk/Glaskugel | e7b892bf34d6fc7a42a31600fec34cf59b08fe87 | [
"MIT"
] | null | null | null | import numpy
# scipy.special for the sigmoid function expit(), and its inverse logit()
import scipy.special
# library for plotting arrays
import matplotlib.pyplot
import Demos
# ensure the plots are inside this notebook, not an external window
demo1 = Demos.NumberDemo()
demo1.run()
| 23.75 | 73 | 0.785965 |
60e755193cef82cfaef11c0b6b4bc6d028e5120b | 6,828 | py | Python | igms/featurize.py | dougalsutherland/igms | 756301ebb65889f689a0d4d3d524dd152dbc85fd | [
"Apache-2.0"
] | 14 | 2019-06-06T07:11:24.000Z | 2020-02-11T23:30:22.000Z | igms/featurize.py | djsutherland/igms | 756301ebb65889f689a0d4d3d524dd152dbc85fd | [
"Apache-2.0"
] | 2 | 2019-06-05T18:42:08.000Z | 2019-06-10T08:00:29.000Z | igms/featurize.py | djsutherland/igms | 756301ebb65889f689a0d4d3d524dd152dbc85fd | [
"Apache-2.0"
] | 2 | 2020-01-05T22:35:53.000Z | 2020-03-13T19:42:02.000Z | from copy import copy
import os
import types
import torch
from torch import nn
from torchvision import models
try:
from torch.nn import Identity
except ImportError: # added in torch 1.1
class Identity(nn.Module):
def forward(self, input):
return input
##################################... | 26.88189 | 87 | 0.612185 |
d52a2c6f73cc04e1a885c7aaf4e2ed0fa1236b32 | 1,679 | py | Python | master/master/communication/handler.py | oleglite/survival | 4b0d7e83428f2047ca0a2477a4f3f3a9e0ae1ef7 | [
"MIT"
] | null | null | null | master/master/communication/handler.py | oleglite/survival | 4b0d7e83428f2047ca0a2477a4f3f3a9e0ae1ef7 | [
"MIT"
] | null | null | null | master/master/communication/handler.py | oleglite/survival | 4b0d7e83428f2047ca0a2477a4f3f3a9e0ae1ef7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from master.utils import tools
from master.utils.exceptions import GameError
def command(func):
def wrapper(self, data):
result = func(self, **data)
self.send_ok(data=result)
return wrapper
class CommandHandler:
def __init__(self, game, ws):
... | 25.830769 | 68 | 0.586659 |
5bad05ae474574b2f3df4b3e8ea71ea623ada584 | 13,272 | py | Python | log_mito_act/model_594.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_594.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_594.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'X... | 79.473054 | 614 | 0.80975 |
20c507a0aa45cb42d5ae09f386ff53fb311d121c | 1,771 | py | Python | src/motion_control/head_node_helpers.py | CircuitLaunch/colab-reachy-ros | f54414ae181beb60a0435611227d77b3a549339e | [
"MIT"
] | null | null | null | src/motion_control/head_node_helpers.py | CircuitLaunch/colab-reachy-ros | f54414ae181beb60a0435611227d77b3a549339e | [
"MIT"
] | 3 | 2021-02-28T06:37:51.000Z | 2021-05-09T05:18:21.000Z | src/motion_control/head_node_helpers.py | CircuitLaunch/colab_reachy_ros | f54414ae181beb60a0435611227d77b3a549339e | [
"MIT"
] | null | null | null | # head node helpers
# makes some of the tedius stuff with creating messages for the head node animation easer
# by oran collins
# github.com/wisehackermonkey
# oranbusiness@gmail.com
# 20210330
from typing import List
from trajectory_msgs.msg import JointTrajectory
from trajectory_msgs.msg import JointTrajectoryPoint... | 43.195122 | 141 | 0.722756 |
df2196ab143a063fcb1ce5411c9e00cbe90f92d1 | 12,643 | py | Python | sweetpea/logic.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | 10 | 2019-03-15T01:30:14.000Z | 2022-03-21T03:41:57.000Z | sweetpea/logic.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | 33 | 2019-03-25T16:30:22.000Z | 2021-07-14T22:31:10.000Z | sweetpea/logic.py | ahsanbutt95/sweetpea-py | d2e2074ef4b20b5f46d8049ca4bb0bf46c3fc705 | [
"MIT"
] | 5 | 2020-09-07T10:20:12.000Z | 2022-01-18T03:11:29.000Z | """This module provides functionality for handling logic formulas."""
from collections import namedtuple
from functools import reduce
from itertools import product
from typing import Any, Dict, List, Tuple, Union, cast
And = namedtuple('And', 'input_list')
Or = namedtuple('Or', 'input_list')
If = namedtuple('If'... | 35.815864 | 103 | 0.628253 |
706cb0fcd79a7f9e69f0ec4b983dad1349b2a30e | 15,359 | py | Python | Monte-Carlo-Attacks/Monte-Carlo-MNIST_CVAE/run_main.py | SAP-samples/security-research-mi-gen-nn | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | 5 | 2020-02-21T15:13:57.000Z | 2021-08-05T15:18:40.000Z | Monte-Carlo-Attacks/Monte-Carlo-MNIST_CVAE/run_main.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | Monte-Carlo-Attacks/Monte-Carlo-MNIST_CVAE/run_main.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
import mnist_data
import os
import vae
import plot_utils
import glob
import argparse
IMAGE_SIZE_MNIST = 28
"""parsing and configuration"""
def parse_args():
desc = "Tensorflow implementation of 'Conditional Variational AutoEncoder (CVAE)'"
parser = argparse.Argument... | 38.301746 | 205 | 0.618009 |
fc953687564c1aaf2d2feeca2412c3fa9dd0b79a | 1,172 | py | Python | twitter_app/twitter.py | nsriniva/DS-Unit-3-Sprint-3-Productization-and-Cloud | 0085c3ddc14d3cf9c3eed597ea3c27489958328e | [
"MIT"
] | null | null | null | twitter_app/twitter.py | nsriniva/DS-Unit-3-Sprint-3-Productization-and-Cloud | 0085c3ddc14d3cf9c3eed597ea3c27489958328e | [
"MIT"
] | null | null | null | twitter_app/twitter.py | nsriniva/DS-Unit-3-Sprint-3-Productization-and-Cloud | 0085c3ddc14d3cf9c3eed597ea3c27489958328e | [
"MIT"
] | null | null | null | """Prediction of Users based on Tweet Embeddings"""
import numpy as np
from sklearn.linear_model import LogisticRegression
import spacy # Vectorizes our tweets
from .models import User
try:
nlp = spacy.load('en_core_web_sm')
except:
spacy.cli.download('en_core_web_sm')
nlp = spacy.load('en_core_web_sm')... | 30.051282 | 107 | 0.726962 |
d0bf9ddf2a1b5e4b50f545954e0579d25793cb8e | 1,748 | py | Python | Wrappers/Python/setup.py | lauramurgatroyd/CILViewer | 3aafa4693498a55ffd270c55118399dd807dee5f | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/setup.py | lauramurgatroyd/CILViewer | 3aafa4693498a55ffd270c55118399dd807dee5f | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/setup.py | lauramurgatroyd/CILViewer | 3aafa4693498a55ffd270c55118399dd807dee5f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 Edoardo Pasca
#
# 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 ap... | 31.214286 | 76 | 0.677346 |
0526cf055d9caaa18802afe4d805e86c1423f6b3 | 1,437 | py | Python | radiosity/odradio/viewfactors/trace.py | hptcad/radiosity | c4a7dba3acd42c4954880d5c7314c2cda14fdd1b | [
"MIT"
] | null | null | null | radiosity/odradio/viewfactors/trace.py | hptcad/radiosity | c4a7dba3acd42c4954880d5c7314c2cda14fdd1b | [
"MIT"
] | null | null | null | radiosity/odradio/viewfactors/trace.py | hptcad/radiosity | c4a7dba3acd42c4954880d5c7314c2cda14fdd1b | [
"MIT"
] | null | null | null | import sys
from functools import wraps
class TraceCalls(object):
""" Use as a decorator on functions that should be traced. Several
functions can be decorated - they will all be indented according
to their call depth.
"""
def __init__(self, stream=sys.stdout, indent_step=2, show_ret=True, d... | 35.925 | 82 | 0.541406 |
eb74b049631a11b8c8d0da0e89159bcc108f6bde | 12,914 | py | Python | subword_nmt/apply_bpe.py | mahjabeen-sust/subword-nmt | 48ba99e657591c329e0003f0c6e32e493fa959ef | [
"MIT"
] | 7 | 2018-04-28T23:36:25.000Z | 2020-12-02T16:54:36.000Z | subword_nmt/apply_bpe.py | mahjabeen-sust/subword-nmt | 48ba99e657591c329e0003f0c6e32e493fa959ef | [
"MIT"
] | 1 | 2020-11-13T17:30:00.000Z | 2020-11-13T17:30:00.000Z | third-party/subword_nmt/apply_bpe.py | isi-vista/VistaMT | 46a918eb7bda8008cd43ca66ab0ffb8cc3b664ff | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Rico Sennrich
"""Use operations learned with learn_bpe.py to encode a new text.
The text will not be smaller, but use only a fixed vocabulary, with rare words
encoded as variable-length sequences of subword units.
Reference:
Rico Sennrich, Barry Haddow and Alexa... | 35.380822 | 217 | 0.603144 |
78f795b3ea4136fb1c08a61fb388b5a71c30212d | 6,149 | py | Python | settings.py | htwangtw/nbackexpsampling | 510971ca9f784a372548b44d00ba1d4c4a84e0af | [
"MIT"
] | 1 | 2021-02-01T18:54:46.000Z | 2021-02-01T18:54:46.000Z | settings.py | htwangtw/nbackexpsampling | 510971ca9f784a372548b44d00ba1d4c4a84e0af | [
"MIT"
] | 2 | 2020-11-13T10:29:05.000Z | 2021-01-27T06:51:58.000Z | settings.py | htwangtw/nbackexpsampling | 510971ca9f784a372548b44d00ba1d4c4a84e0af | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''settings.py
Define global and environment-specific settings here.
'''
# there's a bug in datastructure so don't change the next two lines
BLOCK_TIME = 12
BLOCK_GO_N = 16
# set the two features we used for making the stimulus
shape = ['square', 'triangle', 'circle']
# texture = ['dot', 'soli... | 27.573991 | 108 | 0.621077 |
47ca8407d69d04ed9bf9e24c431df4de71e47c24 | 5,365 | py | Python | tl_algs/tl_baseline.py | raijin0704/tl_algs | 1f9b4329a96eae93610a49aac04f1cc9e1d6ca4f | [
"MIT"
] | 19 | 2017-09-03T05:01:30.000Z | 2021-02-14T02:41:34.000Z | tl_algs/tl_baseline.py | raijin0704/tl_algs | 1f9b4329a96eae93610a49aac04f1cc9e1d6ca4f | [
"MIT"
] | 1 | 2018-09-22T15:09:14.000Z | 2018-09-22T23:10:16.000Z | tl_algs/tl_baseline.py | raijin0704/tl_algs | 1f9b4329a96eae93610a49aac04f1cc9e1d6ca4f | [
"MIT"
] | 7 | 2017-09-06T08:22:15.000Z | 2022-02-07T02:49:57.000Z | import numpy as np
import pandas as pd
import json
from tl_algs import tl_alg
class Target_Baseline(tl_alg.Base_Transfer):
"""
Train classifier using only target or in-domain data, and no source or
cross-domain data.
"""
def __init__(self, test_set_X, test_set_domain, train_pool_X, train_pool_y,
... | 30.833333 | 79 | 0.625163 |
bc05077012f963057180bb495b303b3549bc8d32 | 1,148 | py | Python | apps/routes/models/route_leg.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 19 | 2018-09-04T14:49:01.000Z | 2020-06-09T22:13:10.000Z | apps/routes/models/route_leg.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 50 | 2018-09-18T17:28:57.000Z | 2021-01-09T16:18:45.000Z | apps/routes/models/route_leg.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 4 | 2019-12-15T13:44:18.000Z | 2021-06-09T20:39:54.000Z | """
Copyright 2020 ShipChain, 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, softwar... | 31.027027 | 72 | 0.775261 |
188efe3052252e6ad93ee37f0dea7dfd2474a35c | 984 | py | Python | gertty/alembic/versions/38104b4c1b84_added_project_updated_column.py | igordcard/gertty | 8c78bdc1eff5362d0b216c959d5bb362b2054c26 | [
"Apache-2.0"
] | null | null | null | gertty/alembic/versions/38104b4c1b84_added_project_updated_column.py | igordcard/gertty | 8c78bdc1eff5362d0b216c959d5bb362b2054c26 | [
"Apache-2.0"
] | null | null | null | gertty/alembic/versions/38104b4c1b84_added_project_updated_column.py | igordcard/gertty | 8c78bdc1eff5362d0b216c959d5bb362b2054c26 | [
"Apache-2.0"
] | null | null | null | """Added project updated column
Revision ID: 38104b4c1b84
Revises: 56e48a4a064a
Create Date: 2014-05-31 06:52:12.452205
"""
# revision identifiers, used by Alembic.
revision = '38104b4c1b84'
down_revision = '56e48a4a064a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('project', s... | 28.941176 | 85 | 0.676829 |
71ca86a613d1ac226ef0f34dccd52a4b8cd20ca0 | 11,808 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/pprint.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/pprint.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/pprint.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: pprint.py
"""Support to pretty-print lists, tuples, & dictionaries recursively.
Very simple, but useful, especially in debugging data structures.
C... | 34.729412 | 214 | 0.517361 |
9e3d1293344bbbd5fedf88cec84ba30c531aa7dc | 3,055 | py | Python | demo/examples/stability/euler_d1q222.py | bgraille/pylbm | fd4419933e05b85be364232fddedfcb4f7275e1f | [
"BSD-3-Clause"
] | 106 | 2016-09-13T07:19:17.000Z | 2022-03-19T13:41:55.000Z | demo/examples/stability/euler_d1q222.py | gouarin/pylbm | fd4419933e05b85be364232fddedfcb4f7275e1f | [
"BSD-3-Clause"
] | 53 | 2017-09-18T04:51:19.000Z | 2022-01-19T21:36:23.000Z | demo/examples/stability/euler_d1q222.py | gouarin/pylbm | fd4419933e05b85be364232fddedfcb4f7275e1f | [
"BSD-3-Clause"
] | 33 | 2016-06-17T13:21:17.000Z | 2021-11-11T16:57:46.000Z | """
Stability analysis of the
D1Q222 solver for the Euler system
d_t(rho) + d_x(rho u) = 0,
d_t(rho u) + d_x(rho u^2+p) = 0,
d_t(E) + d_x((E+p) u) = 0,
where E and p are linked by E = 1/2 rho u^2 + p/(gamma-1)
then p = (gamma-1)(E - rho u^2/2)
rho u^2 + p = (gamma-1)E + rho u^2 (3-gamma)/2
"""
i... | 23.867188 | 70 | 0.398363 |
6d345a656c3fd8ebdb9958559ed854bfdf2386d9 | 40,578 | py | Python | nova/tests/unit/virt/libvirt/test_utils.py | Juniper/nova | f7876474846be4b32070cc33c29535a4174aca7f | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_utils.py | Juniper/nova | f7876474846be4b32070cc33c29535a4174aca7f | [
"Apache-2.0"
] | 2 | 2015-02-03T06:25:24.000Z | 2015-02-04T10:10:36.000Z | nova/tests/unit/virt/libvirt/test_utils.py | Juniper/nova | f7876474846be4b32070cc33c29535a4174aca7f | [
"Apache-2.0"
] | 7 | 2015-01-20T10:30:08.000Z | 2020-02-05T10:29:05.000Z | # Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! 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/li... | 41.789907 | 79 | 0.594633 |
21fec4073ac16c39d6f160fea998d6e35fe2358c | 343 | py | Python | scenarios/scripts/test_prob.py | ZeronSix/nru-wifi-coexistence-simulator | e50625ae1328d1bdbfd7f9d2409d8674e357cca0 | [
"MIT"
] | null | null | null | scenarios/scripts/test_prob.py | ZeronSix/nru-wifi-coexistence-simulator | e50625ae1328d1bdbfd7f9d2409d8674e357cca0 | [
"MIT"
] | null | null | null | scenarios/scripts/test_prob.py | ZeronSix/nru-wifi-coexistence-simulator | e50625ae1328d1bdbfd7f9d2409d8674e357cca0 | [
"MIT"
] | null | null | null | from random import randint
RUNS = 200000
def test():
d = dict()
for n in range(16):
d[n] = 0
for n in range(20):
d[randint(0, 15)] += 1
m = 0
for n in range(16):
if d[n] > 0:
return d[n]
return m
data = []
for _ in range(RUNS):
data.append(test())
p... | 13.72 | 30 | 0.495627 |
51a35b286a17dfabd41b58ccd7fb2157a5062872 | 1,241 | py | Python | narrow_setup.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | 6 | 2021-10-09T05:34:04.000Z | 2022-03-31T00:36:55.000Z | narrow_setup.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | null | null | null | narrow_setup.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | null | null | null | # author: muzhan
# contact: levio.pku@gmail.com
import os
import sys
import time
#cmd = ' CUDA_VISIBLE_DEVICES=0,1,2,3 ./tools/dist_train.sh configs/faster_rcnn/faster_rcnn_r50_fpn_1x_voc.py 4 --work-dir ../work_dirs/faster_rcnn_voc'
# cmd = 'sh ./baseline.sh'
cmd = 'sh ./exec.sh'
def gpu_info():
gpu... | 32.657895 | 153 | 0.587429 |
9dc06ec9bef0ec6787eb0f745780b8d71a30ac87 | 2,315 | py | Python | venv/Lib/site-packages/nltk/test/runtests.py | mirosa25/ITI-202-Final-Project | b46e7ffccf43a52ee0e72b889c5aac6887228dc2 | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | venv/Lib/site-packages/nltk/test/runtests.py | mirosa25/ITI-202-Final-Project | b46e7ffccf43a52ee0e72b889c5aac6887228dc2 | [
"MIT"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | venv/Lib/site-packages/nltk/test/runtests.py | mirosa25/ITI-202-Final-Project | b46e7ffccf43a52ee0e72b889c5aac6887228dc2 | [
"MIT"
] | 7 | 2015-09-30T03:00:44.000Z | 2021-06-04T05:34:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import nose
from nose.plugins.manager import PluginManager
from nose.plugins.doctests import Doctest
from nose.plugins import builtin
NLTK_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, NLTK_ROOT)
NLTK_T... | 30.460526 | 93 | 0.634989 |
dd005649ceb4d16d0d37ed4d3ae362bf6559529b | 3,470 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_base_client_async.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from azure.core.pipeline import AsyncPipeline
from azure.core.configuration import Configuration
from azure.core.pipeline.policies import (
UserAgent... | 40.823529 | 107 | 0.673199 |
dd7b1887b0dd104a033699c3d9b622ea1f7ac202 | 749 | py | Python | platform/core/polyaxon/db/models/fields/encrypted_pickledfield.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/db/models/fields/encrypted_pickledfield.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/db/models/fields/encrypted_pickledfield.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | from picklefield import PickledObjectField
import encryptor
class EncryptedPickledObjectField(PickledObjectField):
def get_db_prep_value(self, value, connection=None, prepared=False):
if isinstance(value, bytes):
value = value.decode('utf-8')
value = super().get_db_prep_value(value=va... | 35.666667 | 96 | 0.695594 |
868821aa8e26f2f59b1775e931073593d0e853ee | 2,474 | py | Python | fom/topologies/empty_topology.py | MichalKononenko/FoundationsOfMechanics | d1ca2cc961a98be4761b3938f3a7f58d82daed62 | [
"MIT"
] | null | null | null | fom/topologies/empty_topology.py | MichalKononenko/FoundationsOfMechanics | d1ca2cc961a98be4761b3938f3a7f58d82daed62 | [
"MIT"
] | null | null | null | fom/topologies/empty_topology.py | MichalKononenko/FoundationsOfMechanics | d1ca2cc961a98be4761b3938f3a7f58d82daed62 | [
"MIT"
] | null | null | null | """
Describes an empty topology. This is a topology that has no element, and whose
only open set is an empty set.
"""
from fom.interfaces import Topology
from fom.identity_objects import EmptyContainer, EmptyContainerCollection
from typing import TypeVar, Union, Generic, Container, Tuple, overload
T = TypeVar('T')
Y =... | 27.186813 | 78 | 0.625707 |
8be0ca09fef1c70c3df1b75f4fa3f8f18370d05b | 708 | py | Python | semestr4/kontr5_n8/make_mark.py | iamm3chanic/- | 71d8775e44bda053e76546cfd8cfa1587e8bb15e | [
"MIT"
] | 3 | 2021-01-27T14:48:16.000Z | 2021-08-23T19:34:52.000Z | semestr4/kontr5_n8/make_mark.py | iamm3chanic/- | 71d8775e44bda053e76546cfd8cfa1587e8bb15e | [
"MIT"
] | null | null | null | semestr4/kontr5_n8/make_mark.py | iamm3chanic/- | 71d8775e44bda053e76546cfd8cfa1587e8bb15e | [
"MIT"
] | 7 | 2020-08-05T15:36:54.000Z | 2022-01-09T11:26:23.000Z | #Importing Libraries
import random
from PIL import Image, ImageDraw, ImageFont
#Opening Image & Creating New Text Layer
img = Image.open('pic.bmp').convert("RGBA")
txt = Image.new('RGBA', img.size, (255,255,255,0))
#Creating Text
text = "lectures.stargeo.ru"
font = ImageFont.truetype("20443.otf", 62)
#Creating Draw ... | 24.413793 | 53 | 0.740113 |
bd89c56f367cb5997a7a1752da4529aa6ced8dc0 | 2,698 | py | Python | tests/inte_test/test_duet.py | freedombenLiu/MatchZoo | b1ba96ac8b84e70952f5787f62272ceef8cea106 | [
"Apache-2.0"
] | 2 | 2019-10-04T16:51:36.000Z | 2021-06-09T04:43:35.000Z | tests/inte_test/test_duet.py | ThanhChinhBK/MatchZoo | f77403044bca4ff0a84738921180724a54fd42f9 | [
"Apache-2.0"
] | null | null | null | tests/inte_test/test_duet.py | ThanhChinhBK/MatchZoo | f77403044bca4ff0a84738921180724a54fd42f9 | [
"Apache-2.0"
] | null | null | null | import shutil
import numpy as np
import pytest
import matchzoo as mz
@pytest.fixture(scope='module')
def train_data():
return mz.datasets.toy.load_data(stage='train')
@pytest.fixture(scope='module')
def valid_data():
return mz.datasets.toy.load_data(stage='dev')
@pytest.fixture(scope='module')
def test_... | 27.814433 | 66 | 0.661972 |
847d3e0fc86d69e520efcbda90dae46775bdbbac | 13,989 | py | Python | libcst/_nodes/tests/test_simple_statement.py | jschavesr/LibCST | e5ab7b90b4c9cd1f46e5b875ad317411abf48298 | [
"Apache-2.0"
] | 880 | 2019-08-07T21:21:11.000Z | 2022-03-29T06:25:34.000Z | libcst/_nodes/tests/test_simple_statement.py | jschavesr/LibCST | e5ab7b90b4c9cd1f46e5b875ad317411abf48298 | [
"Apache-2.0"
] | 537 | 2019-08-08T18:34:30.000Z | 2022-03-30T16:46:14.000Z | libcst/_nodes/tests/test_simple_statement.py | jschavesr/LibCST | e5ab7b90b4c9cd1f46e5b875ad317411abf48298 | [
"Apache-2.0"
] | 108 | 2019-08-08T00:17:21.000Z | 2022-03-24T20:53:31.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any
import libcst as cst
from libcst import parse_statement
from libcst._nodes.tests.base import CSTNodeTest, DummyInden... | 39.741477 | 88 | 0.332404 |
9b74c09b26a87de482132462e166eaf0b9e6c000 | 1,925 | py | Python | helpers.py | arieltrevisan/PythonMegaCourseApp1 | d96846069994df137267cb3682c24af31397d390 | [
"MIT"
] | null | null | null | helpers.py | arieltrevisan/PythonMegaCourseApp1 | d96846069994df137267cb3682c24af31397d390 | [
"MIT"
] | null | null | null | helpers.py | arieltrevisan/PythonMegaCourseApp1 | d96846069994df137267cb3682c24af31397d390 | [
"MIT"
] | null | null | null | from os import linesep as os_linesep
from json import load as json_load
from difflib import get_close_matches
exit_keyword = "q"
def load_data() -> dict:
return json_load(open("data.json", "r"))
def read_word(suggested_word: str) -> str:
if suggested_word is None:
word = input("{}Enter word or phra... | 29.166667 | 98 | 0.650909 |
0328387c1d141e7c1e619ef2d382992032fa9e55 | 3,964 | py | Python | 08_StringControl.py | sseonmo/python_basic | 3df849336b91702fbe5cfec1bf5f4547e8ee4207 | [
"DOC"
] | 1 | 2020-01-10T05:14:40.000Z | 2020-01-10T05:14:40.000Z | 08_StringControl.py | sseonmo/python_basic | 3df849336b91702fbe5cfec1bf5f4547e8ee4207 | [
"DOC"
] | null | null | null | 08_StringControl.py | sseonmo/python_basic | 3df849336b91702fbe5cfec1bf5f4547e8ee4207 | [
"DOC"
] | null | null | null | print(dir(str))
"""
str - 문자열을 다루는 기본 클래스(내장클래스)
> dir(str) - 모듈에 어떤 함수 혹은 데이터가 들어있는지 확인 할 수 있다.
1. capitalize() - 첫문자를 대문자를 변경한다.
1. count(keyword, [start, [end] ]) - keyword count 반환
1. encode([encoding, [errors]]) -
1. endswith(postfix, [start, [end]]
print("python is powerful".endswith('ful, 5, -1')) # False
1. ... | 42.623656 | 90 | 0.641524 |
853a58881a1a9e553d5a63bf220c7ea6d8c4680b | 10,118 | py | Python | src/lin_my/s3_rl_collect_visualize.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-01-16T20:24:09.000Z | 2022-01-16T20:24:09.000Z | src/lin_my/s3_rl_collect_visualize.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | null | null | null | src/lin_my/s3_rl_collect_visualize.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-03-16T03:14:37.000Z | 2022-03-16T03:14:37.000Z | import numpy as np
import sys
import random
import os
import time
import argparse
import glob
import matplotlib.pyplot as plt
from functools import partial
try:
from mayavi import mlab as mayalab
except:
pass
np.random.seed(2)
# from contact_point_dataset_torch_multi_label import MyDataset
from hang_dataset impor... | 38.181132 | 161 | 0.717731 |
d34f27e69c0cc04ba3ecda7f49cd195f76cc411b | 350 | py | Python | richtemplates/middleware.py | lordoftheflies/django-richtemplates | 622f8728b286516ed0affb26ecc3d543f43bda3f | [
"BSD-3-Clause"
] | null | null | null | richtemplates/middleware.py | lordoftheflies/django-richtemplates | 622f8728b286516ed0affb26ecc3d543f43bda3f | [
"BSD-3-Clause"
] | 3 | 2020-02-12T03:14:04.000Z | 2021-06-10T22:01:38.000Z | richtemplates/middleware.py | lordoftheflies/django-richtemplates | 622f8728b286516ed0affb26ecc3d543f43bda3f | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponseForbidden
from richtemplates.views import handle403
class Http403Middleware(object):
"""
Handles 403 errors.
"""
def process_response(self, request, response):
if isinstance(response, HttpResponseForbidden):
return handle403(request)
else:... | 25 | 55 | 0.688571 |
d9321b697d33a4c1ee88f71ab78bc59e2a059198 | 3,447 | py | Python | cdx-index-retrieval.py | Alejowilches0112/rpse | 2714a3cafd03496bda22b1e417c034facad1db2a | [
"MIT"
] | null | null | null | cdx-index-retrieval.py | Alejowilches0112/rpse | 2714a3cafd03496bda22b1e417c034facad1db2a | [
"MIT"
] | null | null | null | cdx-index-retrieval.py | Alejowilches0112/rpse | 2714a3cafd03496bda22b1e417c034facad1db2a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from os import listdir, makedirs
from os.path import join, exists
import json
import zlib
import errno
import logging
import requests
from multiprocessing import Pool
from argparse import ArgumentParser
from contextlib import closing
URL_PREFIX = 'http://commoncrawl.s3.amazonaws.com/'
DIR_OUTPUT... | 38.730337 | 112 | 0.62228 |
7fe4e2d9cba4bb090311c7eb4823c648d1672a9c | 8,748 | py | Python | python/euler96.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | python/euler96.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | python/euler96.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | """Problem 96
27 May 2005
Su Doku (Japanese meaning number place) is the name given to a popular
puzzle concept. Its origin is unclear, but credit must be attributed
to Leonhard Euler who invented a similar, and much more difficult,
puzzle idea called Latin Squares. The objective of Su Doku puzzles,
however, is to rep... | 28.966887 | 86 | 0.551326 |
895a8ac20117b621b07c449a5b9ecdea50386d54 | 479 | py | Python | webapp/main.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 7 | 2018-02-10T22:57:28.000Z | 2020-11-20T14:46:18.000Z | webapp/main.py | ebloc/ebloc-broker | 776a8d9d4642ed1ba4726c94da68d61bd81c098b | [
"MIT"
] | 5 | 2020-10-30T18:43:27.000Z | 2021-02-04T12:39:30.000Z | webapp/main.py | ebloc/eBlocBroker | 52d507835a0fe3c930df2e2c816724d26a3484a7 | [
"MIT"
] | 5 | 2017-07-06T14:14:13.000Z | 2019-02-22T14:40:16.000Z | #!/usr/bin/env python3
import config
from flask import Flask, render_template
# Settings
app = Flask(__name__)
app.config.from_pyfile("settings.py")
@app.route("/")
def index():
print(config.Ebb.get_owner())
return app.config.get("WHOAMI")
# home route
@app.route("/")
def hello():
# index()
return... | 18.423077 | 115 | 0.693111 |
ea3ab5ccc743ed5590614755a3aca72548c38e2e | 911 | py | Python | pyrfu/mms/get_variable.py | ablotekar/irfu-python | 740cb51ca9ce2ab0d62cb6fef3a7a722d430d79e | [
"MIT"
] | 2 | 2020-11-27T11:35:42.000Z | 2021-07-17T11:08:10.000Z | pyrfu/mms/get_variable.py | ablotekar/irfu-python | 740cb51ca9ce2ab0d62cb6fef3a7a722d430d79e | [
"MIT"
] | 1 | 2021-12-04T07:55:48.000Z | 2021-12-10T12:45:27.000Z | pyrfu/mms/get_variable.py | ablotekar/irfu-python | 740cb51ca9ce2ab0d62cb6fef3a7a722d430d79e | [
"MIT"
] | 2 | 2021-07-17T11:08:12.000Z | 2021-07-18T18:41:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 3rd party imports
import numpy as np
import xarray as xr
from cdflib import cdfread
__author__ = "Louis Richard"
__email__ = "louisr@irfu.se"
__copyright__ = "Copyright 2020-2021"
__license__ = "MIT"
__version__ = "2.3.7"
__status__ = "Prototype"
def get_variable(fil... | 21.186047 | 79 | 0.635565 |
d34e9b02124c978fb2c4354f02861aec81a51643 | 16,054 | py | Python | graviti/portex/factory.py | wangyuqing0424/graviti-python-sdk | 66300cc1edda6a848cac094899afb3d0421c595d | [
"MIT"
] | null | null | null | graviti/portex/factory.py | wangyuqing0424/graviti-python-sdk | 66300cc1edda6a848cac094899afb3d0421c595d | [
"MIT"
] | null | null | null | graviti/portex/factory.py | wangyuqing0424/graviti-python-sdk | 66300cc1edda6a848cac094899afb3d0421c595d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2022 Graviti. Licensed under MIT License.
#
"""Template factory releated classes."""
from collections import OrderedDict
from typing import (
Any,
Callable,
Dict,
Generic,
List,
Mapping,
Optional,
Set,
Tuple,
Type,
TypeVar,
Union,
)
... | 27.489726 | 99 | 0.605706 |
805a26d6150e64ea5e67741f14ee7899c1093c00 | 11,914 | py | Python | src/cube2common/constants.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 1 | 2020-03-23T20:28:06.000Z | 2020-03-23T20:28:06.000Z | src/cube2common/constants.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | 1 | 2022-02-05T16:59:53.000Z | 2022-02-08T17:30:55.000Z | src/cube2common/constants.py | DanSeraf/spyd | af893b7f9c67785613b25754eb2cf150523a9fe4 | [
"Zlib"
] | null | null | null | from cube2common.utils.enum import enum
MAPVERSION = 33
PROTOCOL_VERSION = 259
# match constants
INTERMISSIONLEN = 10
RESETFLAGTIME = 10000
# string length constants
MAXSERVERDESCLEN = 25
MAXSERVERLEN = 13
MAXNAMELEN = 15
MAXTEAMLEN = 4
MAXAUTHNAMELEN = 100
MAXROOMLEN = 7
AUTHCHALLEN = 49
AUTHANSLEN = 48
AUTHPUBKEYL... | 44.789474 | 225 | 0.560181 |
18729c340a61cd8b0779defb57ab292abbb23d15 | 2,367 | py | Python | tempest/services/compute/json/keypairs_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/compute/json/keypairs_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/compute/json/keypairs_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# 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 requ... | 42.267857 | 78 | 0.700042 |
a0e029d16818e6be92a8c1e3ee7eed6ae09346c0 | 6,393 | py | Python | tests/test_applications.py | Lokaltog/axis | f602ef8089ed0332317274e0433f4ede75109533 | [
"MIT"
] | null | null | null | tests/test_applications.py | Lokaltog/axis | f602ef8089ed0332317274e0433f4ede75109533 | [
"MIT"
] | null | null | null | tests/test_applications.py | Lokaltog/axis | f602ef8089ed0332317274e0433f4ede75109533 | [
"MIT"
] | null | null | null | """Test Axis Applications API.
pytest --cov-report term-missing --cov=axis.applications tests/test_applications.py
"""
from asynctest import Mock
import pytest
from axis.applications import Applications
@pytest.fixture
def applications() -> Applications:
"""Returns the api_discovery mock object."""
mock_re... | 44.089655 | 271 | 0.714844 |
029cc1f47360cdfa7442ec4e81b877a13adee477 | 188 | py | Python | tests/packages/ParseFailures/python2file.py | Thom1729/st_package_reviewer | 71e4eaad60fe3391b0a4d39405b784ec84ea58bc | [
"MIT"
] | 8 | 2017-06-07T07:52:32.000Z | 2021-04-26T23:46:36.000Z | tests/packages/ParseFailures/python2file.py | Thom1729/st_package_reviewer | 71e4eaad60fe3391b0a4d39405b784ec84ea58bc | [
"MIT"
] | 26 | 2017-05-29T21:11:10.000Z | 2021-05-16T20:58:23.000Z | tests/packages/ParseFailures/python2file.py | Thom1729/st_package_reviewer | 71e4eaad60fe3391b0a4d39405b784ec84ea58bc | [
"MIT"
] | 8 | 2017-05-31T21:16:49.000Z | 2021-03-20T16:43:26.000Z | import sublime_plugin
class AwesomeFooCommand(sublime_plugin.ApplicationCommand):
def run(self):
# Used to be okay in Python2; no longer the case in Python3.
print "Hello, world!"
| 20.888889 | 62 | 0.765957 |
951dc8d8128374a0aea859781517dd8d2f88d8fa | 38,111 | py | Python | manim/scene/scene.py | jamesetouma/manim | 2834fbbba6dae88d64bd3ae46d9c8c6271eacfc7 | [
"MIT"
] | null | null | null | manim/scene/scene.py | jamesetouma/manim | 2834fbbba6dae88d64bd3ae46d9c8c6271eacfc7 | [
"MIT"
] | null | null | null | manim/scene/scene.py | jamesetouma/manim | 2834fbbba6dae88d64bd3ae46d9c8c6271eacfc7 | [
"MIT"
] | null | null | null | """A Scene is the canvas of the animation."""
__all__ = ["Scene", "EndSceneEarlyException"]
import inspect
import random
import warnings
import platform
import copy
from tqdm import tqdm as ProgressDisplay
import numpy as np
from .. import camera_config, file_writer_config, logger
from ..animation.animation impor... | 32.134064 | 168 | 0.586445 |
0c04491e17122cd15ebeb35445ccda581c70d21d | 4,474 | py | Python | pcdet/models/backbones_2d/base_bev_backbone.py | mingjitianming/OpenPCDet | ea12bb874eb30bdc6a181ff82e677ba5557ead85 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_2d/base_bev_backbone.py | mingjitianming/OpenPCDet | ea12bb874eb30bdc6a181ff82e677ba5557ead85 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_2d/base_bev_backbone.py | mingjitianming/OpenPCDet | ea12bb874eb30bdc6a181ff82e677ba5557ead85 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
class BaseBEVBackbone(nn.Module):
def __init__(self, model_cfg, input_channels): #256
super().__init__()
self.model_cfg = model_cfg
if self.model_cfg.get('LAYER_NUMS', None) is not None:
assert len(self.model_cfg.LAYER_NUM... | 39.245614 | 121 | 0.518105 |
d39be577a38a759855e405b999de9b1436512d21 | 1,438 | py | Python | stubs.min/System/Diagnostics/__init___parts/EventTypeFilter.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Diagnostics/__init___parts/EventTypeFilter.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Diagnostics/__init___parts/EventTypeFilter.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class EventTypeFilter(TraceFilter):
"""
Indicates whether a listener should trace based on the event type.
EventTypeFilter(level: SourceLevels)
"""
def ShouldTrace(self,cache,source,eventType,id,formatOrMessage,args,data1,data):
"""
ShouldTrace(self: EventTypeFilter,cache: TraceEventCache,source: s... | 36.871795 | 190 | 0.718359 |
db47f513e6307690d6c20b66a4f6a162c9d5f80f | 1,278 | py | Python | setup.py | amol-mandhane/htmlPy | e2fee25959b884604a6860f7ddca86f4223f5b91 | [
"MIT"
] | 555 | 2015-08-20T11:11:01.000Z | 2021-12-25T20:23:35.000Z | setup.py | nuno-andre/htmlPy | e2fee25959b884604a6860f7ddca86f4223f5b91 | [
"MIT"
] | 39 | 2015-11-22T01:54:07.000Z | 2018-06-15T11:52:07.000Z | setup.py | nuno-andre/htmlPy | e2fee25959b884604a6860f7ddca86f4223f5b91 | [
"MIT"
] | 83 | 2015-11-21T23:55:28.000Z | 2022-03-18T18:59:58.000Z | from setuptools import setup
import sys
requirements = ["Jinja2(>=2.6)"]
if "win" in sys.platform:
requirements.append("PySide(>=1.2.2)")
setup(
name='htmlPy',
version='2.0.3',
author='Amol Mandhane',
author_email='amol.mandhane@gmail.com',
packages=['htmlPy'],
scripts=[],
url='http:/... | 32.769231 | 75 | 0.626761 |
75b517d6829e57dc8292ce27d34dc22cef87500b | 3,060 | py | Python | resotocore/tests/core/model/adjust_node_test.py | MrMarvin/cloudkeeper | cdca21c1a3b945da6e53a5dbb37a437e1d46f557 | [
"Apache-2.0"
] | null | null | null | resotocore/tests/core/model/adjust_node_test.py | MrMarvin/cloudkeeper | cdca21c1a3b945da6e53a5dbb37a437e1d46f557 | [
"Apache-2.0"
] | null | null | null | resotocore/tests/core/model/adjust_node_test.py | MrMarvin/cloudkeeper | cdca21c1a3b945da6e53a5dbb37a437e1d46f557 | [
"Apache-2.0"
] | null | null | null | import re
from datetime import datetime
from typing import Optional, Union, Pattern, Any
from core.model.adjust_node import DirectAdjuster, NoAdjust
from core.types import Json
from core.util import utc_str, value_in_path
def test_adjust_expired() -> None:
adjuster = DirectAdjuster()
created_at = datetime(2... | 43.098592 | 105 | 0.635948 |
4cbb41f35f80925debc84bd66a0388b6a573bc01 | 1,855 | py | Python | dumb_frotz.py | dgouldin/twinfocom | e1c58b127306d3a81e465b52afa9876c118f5a8c | [
"MIT"
] | 4 | 2015-01-23T22:59:39.000Z | 2020-11-18T16:17:37.000Z | dumb_frotz.py | dgouldin/twinfocom | e1c58b127306d3a81e465b52afa9876c118f5a8c | [
"MIT"
] | null | null | null | dumb_frotz.py | dgouldin/twinfocom | e1c58b127306d3a81e465b52afa9876c118f5a8c | [
"MIT"
] | null | null | null | import os
import subprocess
DFROTZ = '/usr/local/bin/dfrotz'
def format_output(output, load, command, save):
"""
Yeah, it's ugly.
Big whoop.
Wanna fight about it?
"""
lines = filter(lambda l: l and l != '>', output.split('\n'))
from_line = 5
to_line = 0
if command or load:
... | 26.5 | 80 | 0.557951 |
97dcd3110301639e06e041a412d91ac16dc677da | 12,245 | py | Python | mst/ecc.py | commerceblock/pymainstay | 50987e147fd81c1e94b9dec08290cfb30076d3fd | [
"MIT"
] | null | null | null | mst/ecc.py | commerceblock/pymainstay | 50987e147fd81c1e94b9dec08290cfb30076d3fd | [
"MIT"
] | 10 | 2019-11-16T17:46:36.000Z | 2021-04-30T21:20:40.000Z | mst/ecc.py | commerceblock/pymainstay | 50987e147fd81c1e94b9dec08290cfb30076d3fd | [
"MIT"
] | null | null | null | # Copyright (c) 2019 CommerceBlock Team
# Use of this source code is governed by an MIT
# license that can be found in the LICENSE file.
# Copyright (C) 2018 The Electrum developers
import base64
import hmac
import hashlib
import sys
from typing import Union
import time
import random
import os
import binascii
import... | 34.590395 | 112 | 0.648836 |
e1b3c2cb6dca1149e0a0b995d35977d74e04e4fe | 2,660 | py | Python | python/paddle/fluid/tests/unittests/test_parallel_executor_pg.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 1 | 2019-09-05T07:32:44.000Z | 2019-09-05T07:32:44.000Z | python/paddle/fluid/tests/unittests/test_parallel_executor_pg.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 1 | 2019-05-26T14:23:24.000Z | 2019-05-26T14:23:51.000Z | python/paddle/fluid/tests/unittests/test_parallel_executor_pg.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 1 | 2019-07-19T06:47:23.000Z | 2019-07-19T06:47:23.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 32.048193 | 81 | 0.668045 |
8f6c579cbc8fd9915d21b5f5d3c3a5bf5f0ac890 | 3,422 | py | Python | gui/OutputRegion.py | eecheve/Gaussian-2-Blender | 14811ad6092ec7be09b043752a2db3514599eede | [
"Apache-2.0"
] | 1 | 2021-09-17T21:33:45.000Z | 2021-09-17T21:33:45.000Z | gui/OutputRegion.py | eecheve/Gaussian-2-Blender | 14811ad6092ec7be09b043752a2db3514599eede | [
"Apache-2.0"
] | null | null | null | gui/OutputRegion.py | eecheve/Gaussian-2-Blender | 14811ad6092ec7be09b043752a2db3514599eede | [
"Apache-2.0"
] | 1 | 2021-09-19T21:38:24.000Z | 2021-09-19T21:38:24.000Z | import tkinter as tk
import CreateTooltip
tooltip = CreateTooltip.CreateTooltip
class OutputRegion(object):
"""Section of the app that selects the output path for the converted file(s)"""
def __init__(self, parent, initial_dir):
self.def_outputPath = initial_dir + "\\output\\"
self.initial_dir... | 43.871795 | 103 | 0.516949 |
538944e5bbddd900df05a054f0964aae28de566b | 7,567 | py | Python | streetview.py | wanjawischmeier/google-street-view-panorama-download | f9299bf092d339800d06b0e0d6dabf5645684bd6 | [
"MIT"
] | null | null | null | streetview.py | wanjawischmeier/google-street-view-panorama-download | f9299bf092d339800d06b0e0d6dabf5645684bd6 | [
"MIT"
] | null | null | null | streetview.py | wanjawischmeier/google-street-view-panorama-download | f9299bf092d339800d06b0e0d6dabf5645684bd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Original code is from https://github.com/robolyst/streetview
Functions added in this file are
download_panorama_v1, download_panorama_v2, download_panorama_v3
Usage:
given latitude and longitude
panoids = panoids( lat, lon )
panoid = panoids[0]['panoid']
panorama_img = downl... | 32.616379 | 262 | 0.604863 |
2cd61d66566ac1c92cbbac25a07fb0225028e7ff | 1,962 | py | Python | autodp/rl_core/agent/base_agent.py | IBM/automation-of-image-data-preprocessing | a5327b1b6da3f5fc92dae4dfeb235c5f24378589 | [
"MIT"
] | 5 | 2020-11-26T16:31:56.000Z | 2022-03-02T23:11:19.000Z | autodp/rl_core/agent/base_agent.py | IBM/automation-of-image-data-preprocessing | a5327b1b6da3f5fc92dae4dfeb235c5f24378589 | [
"MIT"
] | null | null | null | autodp/rl_core/agent/base_agent.py | IBM/automation-of-image-data-preprocessing | a5327b1b6da3f5fc92dae4dfeb235c5f24378589 | [
"MIT"
] | null | null | null | import abc
import pickle
from autodp import cf
class BaseAgent(metaclass=abc.ABCMeta):
"""This abstract class defines methods exposed by a reinforcement learning agent."""
def __init__(self):
# Setup neural network functions
self._setup_policy()
@staticmethod
def _add_extra_example(... | 30.65625 | 97 | 0.601937 |
336edfde53a9de6f93500272de71a50a9d8d51e4 | 1,894 | py | Python | tools/memory_inspector/classification_rules/default/mmap-android.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/memory_inspector/classification_rules/default/mmap-android.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/memory_inspector/classification_rules/default/mmap-android.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is a generic rule-tree for classifying memory maps on Android. It is a
# simple hierarchical python data structure (list of dictionaries). Some rules:... | 22.547619 | 79 | 0.536959 |
784601fcc01b6bf48b62a8e9a7672e3a2395fc39 | 4,279 | py | Python | tests/io/test_fstrips_full_domains_parsing.py | LAPKT-dev/tarski-lapkt | f7ba01bf704af5144a32206ce9479ca5880042ed | [
"Apache-2.0"
] | null | null | null | tests/io/test_fstrips_full_domains_parsing.py | LAPKT-dev/tarski-lapkt | f7ba01bf704af5144a32206ce9479ca5880042ed | [
"Apache-2.0"
] | null | null | null | tests/io/test_fstrips_full_domains_parsing.py | LAPKT-dev/tarski-lapkt | f7ba01bf704af5144a32206ce9479ca5880042ed | [
"Apache-2.0"
] | null | null | null | from tarski.fstrips.representation import is_unit_cost_problem, is_unit_cost_action, is_zero_cost_action, \
is_constant_cost_action
from tests.common.benchmarks import get_lenient_benchmarks
from .common import reader, collect_strips_benchmarks, collect_fstrips_benchmarks, parse_benchmark_instance
# Let's make sur... | 42.366337 | 119 | 0.739892 |
e0ec44b9bbeee1fa77455d444a5c8a18f97e0531 | 3,464 | py | Python | pyapprox/equilibrium_sampling.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 26 | 2019-12-16T02:21:15.000Z | 2022-03-17T09:59:18.000Z | pyapprox/equilibrium_sampling.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 9 | 2020-03-03T03:04:55.000Z | 2021-08-19T22:50:42.000Z | pyapprox/equilibrium_sampling.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 7 | 2020-03-02T03:49:17.000Z | 2021-02-17T02:07:53.000Z | import warnings
import numpy as np
def hermite_univariate_equilibrium_sampling(num_pts,degree=1):
"""
Univariate scaled sampling from the weighted equilibrium measure on
(-Inf, Inf).
Samples num_pts samples from the univariate weighted equilibrium
measure, whose unnormalized density is
rh... | 31.490909 | 82 | 0.659353 |
7886f4da25c3d954f4d9eefb0653db8b43533e77 | 3,815 | py | Python | auto_nag/scripts/missed_uplifts.py | DharmikNaik/relman-auto-nag | ec454284e75a28eb296387b6b4185193a81157db | [
"BSD-3-Clause"
] | 27 | 2015-10-16T05:30:02.000Z | 2021-12-17T11:25:12.000Z | auto_nag/scripts/missed_uplifts.py | DharmikNaik/relman-auto-nag | ec454284e75a28eb296387b6b4185193a81157db | [
"BSD-3-Clause"
] | 1,053 | 2015-09-10T12:32:03.000Z | 2022-03-31T18:00:07.000Z | auto_nag/scripts/missed_uplifts.py | DharmikNaik/relman-auto-nag | ec454284e75a28eb296387b6b4185193a81157db | [
"BSD-3-Clause"
] | 34 | 2015-10-06T15:45:08.000Z | 2022-01-03T15:14:55.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from auto_nag import utils
from auto_nag.bzcleaner import BzCleaner
class MissedUplifts(BzCleaner):
def __init__(s... | 32.058824 | 81 | 0.557536 |
62263c74afb091993336b93bb12310e2c0760758 | 631 | py | Python | tests/test_mocks.py | tlancaster6/InternetOfFish | 413d53f83a98bfd537fd2789c8943f06d6d3ee63 | [
"MIT"
] | 1 | 2022-03-14T21:44:50.000Z | 2022-03-14T21:44:50.000Z | tests/test_mocks.py | tlancaster6/InternetOfFish | 413d53f83a98bfd537fd2789c8943f06d6d3ee63 | [
"MIT"
] | null | null | null | tests/test_mocks.py | tlancaster6/InternetOfFish | 413d53f83a98bfd537fd2789c8943f06d6d3ee63 | [
"MIT"
] | 1 | 2022-03-22T18:51:15.000Z | 2022-03-22T18:51:15.000Z | from context import runner, detector, mptools, metadata
import pytest
# @pytest.fixture
# def mock_metadata():
# mm = metadata.MetaDataDict()
# mm.quick_update({'owner': 'foo',
# 'species': 'bar',
# 'fish_type': 'other',
# 'model_id': 'efficientdet... | 30.047619 | 58 | 0.616482 |
81ed880fa2061feb5ec949989c1b9b99d2c6d708 | 499 | py | Python | app/db/schemas.py | oaguy1/votelist-api | 676e4b3b2e31ec8605e99d6b38ebbd124ffaea64 | [
"MIT"
] | null | null | null | app/db/schemas.py | oaguy1/votelist-api | 676e4b3b2e31ec8605e99d6b38ebbd124ffaea64 | [
"MIT"
] | null | null | null | app/db/schemas.py | oaguy1/votelist-api | 676e4b3b2e31ec8605e99d6b38ebbd124ffaea64 | [
"MIT"
] | null | null | null | from typing import List, Optional
from pydantic import BaseModel
class ItemBase(BaseModel):
title: str
description: Optional[str] = None
class ItemCreate(ItemBase):
pass
class Item(ItemBase):
id: int
owner_id: int
class Config:
orm_mode = True
class UserBase(BaseModel):
ema... | 14.257143 | 37 | 0.659319 |
68fd440df079914c0509dc9f643768df38498c92 | 594 | py | Python | app/api/ministry/migrations/0003_auto_20210917_1132.py | lunyamwis/laylinks-bend | 04ff9ebb5da482e5b2642a89654a5b5f0128eaaa | [
"MIT"
] | null | null | null | app/api/ministry/migrations/0003_auto_20210917_1132.py | lunyamwis/laylinks-bend | 04ff9ebb5da482e5b2642a89654a5b5f0128eaaa | [
"MIT"
] | null | null | null | app/api/ministry/migrations/0003_auto_20210917_1132.py | lunyamwis/laylinks-bend | 04ff9ebb5da482e5b2642a89654a5b5f0128eaaa | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-17 08:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ministry', '0002_auto_20210906_0526'),
]
operations = [
migrations.AlterField(
model_name='ministry',
name='home_chu... | 24.75 | 62 | 0.602694 |
a20f65abbcb026aa64a55ff2ee91ba290964e880 | 207 | py | Python | flask-backend/api/schema/task.py | harshagrawal523/OpenMF | a591aacae5386cf381342afe26b063192318c920 | [
"Apache-2.0"
] | 92 | 2018-03-22T12:19:04.000Z | 2022-03-28T17:53:25.000Z | flask-backend/api/schema/task.py | harshagrawal523/OpenMF | a591aacae5386cf381342afe26b063192318c920 | [
"Apache-2.0"
] | 190 | 2019-05-12T02:24:31.000Z | 2022-03-27T05:24:55.000Z | flask-backend/api/schema/task.py | harshagrawal523/OpenMF | a591aacae5386cf381342afe26b063192318c920 | [
"Apache-2.0"
] | 76 | 2018-10-02T13:38:37.000Z | 2022-03-23T15:07:57.000Z | """
Schema for task model.
"""
from api.extansions import ma
class TaskSchema(ma.Schema):
class Meta:
fields = ("id","title", "description", "assinged_on", "due_on", "is_completed", "admin_id")
| 23 | 99 | 0.657005 |
0ea10363a2468298447f5cea7837714f97507677 | 139 | py | Python | python/Strings/python-string-split-and-join.py | cdrowley/hackerrank | cc5c925327cd3ce5b52c1614b814da75d42cca72 | [
"MIT"
] | null | null | null | python/Strings/python-string-split-and-join.py | cdrowley/hackerrank | cc5c925327cd3ce5b52c1614b814da75d42cca72 | [
"MIT"
] | null | null | null | python/Strings/python-string-split-and-join.py | cdrowley/hackerrank | cc5c925327cd3ce5b52c1614b814da75d42cca72 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/python-string-split-and-join/problem
def split_and_join(line):
return "-".join(line.split())
| 23.166667 | 76 | 0.733813 |
e15158790240898bf0fa3bbb732eb80ed3ed35e9 | 6,161 | py | Python | algorithms/clustering/unit_cell.py | jbeilstenedmands/dials | fb9672b91854f564cbbba6f1cceeefa18d135965 | [
"BSD-3-Clause"
] | null | null | null | algorithms/clustering/unit_cell.py | jbeilstenedmands/dials | fb9672b91854f564cbbba6f1cceeefa18d135965 | [
"BSD-3-Clause"
] | 2 | 2020-07-31T22:37:30.000Z | 2020-07-31T23:08:55.000Z | algorithms/clustering/unit_cell.py | jbeilstenedmands/dials | fb9672b91854f564cbbba6f1cceeefa18d135965 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
# modified version of the ab_cluster function so we can access the scipy dendrogram object
from xfel.clustering.cluster import Cluster
import logging
logger = logging.getLogger(__name__)
class UnitCellCluster(Cluster):
def ab_cluster(
sel... | 39.49359 | 129 | 0.584483 |
0ec4be92be4aa3c345ac4f7d91f0d0f2bbfc84a1 | 861 | py | Python | clicktest.py | jima80525/command_line_review | 178cba3575204463c08c72d7dda97bed162fad37 | [
"MIT"
] | null | null | null | clicktest.py | jima80525/command_line_review | 178cba3575204463c08c72d7dda97bed162fad37 | [
"MIT"
] | null | null | null | clicktest.py | jima80525/command_line_review | 178cba3575204463c08c72d7dda97bed162fad37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import click
@click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.option('-l', '--limit', type=int, default=0, help='Smallest value shown')
@click.option('-i', '--include', help='Show only these comma separated commands')
@click.option('-e', '--exclude', help='Exclude... | 31.888889 | 81 | 0.634146 |
ce5d5cc8035abb8ec17b242a4ca501645a70ff6a | 212 | py | Python | convert_page.py | raboof/serverless-wiki | 558cd6ba8c87d30a2708fb887f4632b8921402e1 | [
"MIT"
] | 15 | 2017-12-15T19:30:43.000Z | 2021-09-09T09:55:20.000Z | convert_page.py | raboof/serverless-wiki | 558cd6ba8c87d30a2708fb887f4632b8921402e1 | [
"MIT"
] | 6 | 2017-10-11T22:08:47.000Z | 2018-03-26T14:21:16.000Z | convert_page.py | raboof/serverless-wiki | 558cd6ba8c87d30a2708fb887f4632b8921402e1 | [
"MIT"
] | 4 | 2018-01-12T07:44:29.000Z | 2021-09-09T09:55:21.000Z | #!/usr/bin/env python
import sys
import fileinput
import os
import templating
markdown = ''
for line in fileinput.input():
markdown += line
print(templating.apply_template(markdown, os.environ['POST_URL']))
| 16.307692 | 66 | 0.754717 |
571ddc521b295eda0aeced5ea7651f194fe8d48d | 5,001 | py | Python | modeflip/valid_model/base.py | lmcgnlzt/modeflip | 415e9441561fe0ba40544b8313d912dd65c93981 | [
"Apache-2.0"
] | null | null | null | modeflip/valid_model/base.py | lmcgnlzt/modeflip | 415e9441561fe0ba40544b8313d912dd65c93981 | [
"Apache-2.0"
] | null | null | null | modeflip/valid_model/base.py | lmcgnlzt/modeflip | 415e9441561fe0ba40544b8313d912dd65c93981 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
The purpose of the Object class is to be able to create objects from arbitrary
dictionaries and be able to validate them. Primarily this is for being used
with MongoDB to validate documents and to ensure that all expected fields exists
and only those defined fields exist.
There is no direct t... | 28.907514 | 80 | 0.704459 |
1090acb01e992c04f9ff507a29453c1e4e212a29 | 12,184 | py | Python | tests/components/cloud/test_http_api.py | jamescurtin/home-assistant | 6a9968ccb9b0082f5629e50955549d432aba7d90 | [
"Apache-2.0"
] | 2 | 2020-02-20T18:47:55.000Z | 2021-11-09T11:33:28.000Z | tests/components/cloud/test_http_api.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | 1 | 2021-02-08T20:56:06.000Z | 2021-02-08T20:56:06.000Z | tests/components/cloud/test_http_api.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | 1 | 2020-11-21T09:37:47.000Z | 2020-11-21T09:37:47.000Z | """Tests for the HTTP API for the cloud component."""
import asyncio
from unittest.mock import patch, MagicMock
import pytest
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.cloud import DOMAIN, auth_api
from tests.common import mock_coro
@pytest.fixture
def cloud_client(has... | 34.418079 | 79 | 0.679662 |
f9e96c8fde29418c702283a16773832f55b165e9 | 1,090 | py | Python | python/rikai/tensorflow/models/__init__.py | askintution/rikai | 53a72a19beafc4097a816efb9cddd063e107e67a | [
"Apache-2.0"
] | 1 | 2022-02-18T07:53:29.000Z | 2022-02-18T07:53:29.000Z | python/rikai/tensorflow/models/__init__.py | askintution/rikai | 53a72a19beafc4097a816efb9cddd063e107e67a | [
"Apache-2.0"
] | null | null | null | python/rikai/tensorflow/models/__init__.py | askintution/rikai | 53a72a19beafc4097a816efb9cddd063e107e67a | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Rikai 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 wri... | 32.058824 | 75 | 0.727523 |
cb332765ed4fcac52c646f8579273405ed530c42 | 10,129 | py | Python | tests/test_projectcounts/test_daily_aggregation.py | wikimedia/analytics-aggregator | e07c0dc2d3102a591e5e968a7e4c49499770fe39 | [
"Apache-2.0"
] | 1 | 2018-01-09T07:49:21.000Z | 2018-01-09T07:49:21.000Z | tests/test_projectcounts/test_daily_aggregation.py | wikimedia/analytics-aggregator | e07c0dc2d3102a591e5e968a7e4c49499770fe39 | [
"Apache-2.0"
] | null | null | null | tests/test_projectcounts/test_daily_aggregation.py | wikimedia/analytics-aggregator | e07c0dc2d3102a591e5e968a7e4c49499770fe39 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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
#... | 33.429043 | 79 | 0.539935 |
d779fb44a514abeaec8d02838a32fe42b0fbe0eb | 4,007 | py | Python | care/users/tests/test_users.py | Kailaash-Balachandran/care | bd10c3fa73f5bca2435b34b8f9a97b7f953b1d95 | [
"MIT"
] | 1 | 2020-09-04T05:25:21.000Z | 2020-09-04T05:25:21.000Z | care/users/tests/test_users.py | andy1729/care | bd10c3fa73f5bca2435b34b8f9a97b7f953b1d95 | [
"MIT"
] | null | null | null | care/users/tests/test_users.py | andy1729/care | bd10c3fa73f5bca2435b34b8f9a97b7f953b1d95 | [
"MIT"
] | null | null | null | import pytest
from config.tests.helper import client, user
from care.users.models import User
@pytest.fixture()
def data():
return {
"user_type": 5,
"email": "some.email@somedomain.com",
"phone_number": "5554446667",
"age": 30,
"gender": 1,
"district": 11,
... | 35.149123 | 86 | 0.591964 |
0f15320a4ffbc7c4122ace7efee55b62cef77b35 | 11,497 | py | Python | scripts/run_by_epoch.py | edeno/Replay_ID_2018 | 1ae92d7bed08e9bbcf2246ffa284552ffa88cc6d | [
"MIT"
] | null | null | null | scripts/run_by_epoch.py | edeno/Replay_ID_2018 | 1ae92d7bed08e9bbcf2246ffa284552ffa88cc6d | [
"MIT"
] | null | null | null | scripts/run_by_epoch.py | edeno/Replay_ID_2018 | 1ae92d7bed08e9bbcf2246ffa284552ffa88cc6d | [
"MIT"
] | null | null | null | import itertools
import logging
import os
import sys
from argparse import ArgumentParser
from signal import SIGUSR1, SIGUSR2, signal
from subprocess import PIPE, run
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
from dask.distributed import Client
from loren_frank_data_processing.position impo... | 41.959854 | 80 | 0.616074 |
316c2f036cd8d8818c21ffe3e66091aee297b87f | 1,960 | py | Python | legistar/cities/chicago.py | datamade/python-legistar-scraper | ac379c6bd0437db85cecf469f34b02baedb1ae7e | [
"BSD-3-Clause"
] | 1 | 2021-12-27T12:07:20.000Z | 2021-12-27T12:07:20.000Z | legistar/cities/chicago.py | datamade/python-legistar-scraper | ac379c6bd0437db85cecf469f34b02baedb1ae7e | [
"BSD-3-Clause"
] | null | null | null | legistar/cities/chicago.py | datamade/python-legistar-scraper | ac379c6bd0437db85cecf469f34b02baedb1ae7e | [
"BSD-3-Clause"
] | 2 | 2019-05-01T20:09:29.000Z | 2019-05-16T19:35:14.000Z | from pupa.scrape import Jurisdiction, Organization
from legistar.people import LegistarPersonScraper
class ChicagoPersonScraper(LegistarPersonScraper):
DEFAULT_PRIMARY_ORG = 'legislature'
orgs_by_name = {}
def skip_item(self, item):
return item['district'] == ''
def modify_object_args(self,... | 32.666667 | 88 | 0.641327 |
ca37838bef83442c398c269acff2b3f62e8821e6 | 822 | py | Python | setup.py | jonathanvanschenck/smip | 189a5a6dab743927a2d8d82504e7a1e92dfed564 | [
"MIT"
] | null | null | null | setup.py | jonathanvanschenck/smip | 189a5a6dab743927a2d8d82504e7a1e92dfed564 | [
"MIT"
] | null | null | null | setup.py | jonathanvanschenck/smip | 189a5a6dab743927a2d8d82504e7a1e92dfed564 | [
"MIT"
] | null | null | null | import os
from setuptools import setup, find_packages
def read(fp):
with open(os.path.join(os.path.dirname(__file__), fp)) as f:
return f.read()
setup(
name='smip',
version='0.1.0',
description='Render local markdown files, with scripture references automatically scraped from the web.',
l... | 32.88 | 109 | 0.682482 |
bc20f94ac82efa566f5d9ef4a1b878b1643085fe | 2,580 | py | Python | predict.py | hymenoby/ucacity-image-classifier | f84e822f10e4fb6a1d2b40861a7e5714caf4a0eb | [
"MIT"
] | null | null | null | predict.py | hymenoby/ucacity-image-classifier | f84e822f10e4fb6a1d2b40861a7e5714caf4a0eb | [
"MIT"
] | null | null | null | predict.py | hymenoby/ucacity-image-classifier | f84e822f10e4fb6a1d2b40861a7e5714caf4a0eb | [
"MIT"
] | null | null | null | import argparse
import errno
import sys
import time
import torch
import os
import utils
from torchvision import models
from torch import nn
from torch import optim
# get arguments
parser = argparse.ArgumentParser(description="Predict image")
parser.add_argument('image_path', action='store',
help='P... | 34.864865 | 119 | 0.658527 |
854f97b76cede5b94d7bc979116d469a1add8859 | 204 | py | Python | tracing_app/users/tests/test_models.py | jsmera/tracing_app | d55d460f7307ea450aa6233663b80ed3347cd27f | [
"MIT"
] | null | null | null | tracing_app/users/tests/test_models.py | jsmera/tracing_app | d55d460f7307ea450aa6233663b80ed3347cd27f | [
"MIT"
] | null | null | null | tracing_app/users/tests/test_models.py | jsmera/tracing_app | d55d460f7307ea450aa6233663b80ed3347cd27f | [
"MIT"
] | null | null | null | import pytest
from tracing_app.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 20.4 | 64 | 0.77451 |
37f4b0f36d027aba33514f6d7c838a2d56f986f3 | 1,472 | py | Python | tensorflow/contrib/bayesflow/__init__.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 6 | 2016-09-07T18:38:41.000Z | 2020-01-12T23:01:03.000Z | tensorflow/contrib/bayesflow/__init__.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/bayesflow/__init__.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 8 | 2017-06-08T09:46:06.000Z | 2021-06-20T14:03:19.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 47.483871 | 82 | 0.775136 |
a95a8fdf31bed05281212bad928d4094ca5f4bcd | 371 | py | Python | uploads/core/migrations/0011_auto_20190331_0337.py | emawind84/rrwebtv | ae22cd39ea430aed0de2b852e40c309465a7237b | [
"MIT"
] | null | null | null | uploads/core/migrations/0011_auto_20190331_0337.py | emawind84/rrwebtv | ae22cd39ea430aed0de2b852e40c309465a7237b | [
"MIT"
] | 2 | 2020-06-05T20:13:36.000Z | 2021-06-10T21:18:43.000Z | uploads/core/migrations/0011_auto_20190331_0337.py | emawind84/rrwebtv | ae22cd39ea430aed0de2b852e40c309465a7237b | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-03-31 03:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0010_remove_document_replays'),
]
operations = [
migrations.AlterModelOptions(
name='document',
options={'ordering'... | 20.611111 | 64 | 0.606469 |
8f11b9849c24fbc83b1cbe578030c36570b7771c | 345 | py | Python | worker/__init__.py | gaosanshi/swiper | 72af8f337fb18d9d18ab740ef3be1011ca188f40 | [
"MIT"
] | null | null | null | worker/__init__.py | gaosanshi/swiper | 72af8f337fb18d9d18ab740ef3be1011ca188f40 | [
"MIT"
] | 2 | 2020-06-05T19:37:32.000Z | 2021-06-10T21:01:46.000Z | worker/__init__.py | gaosanshi/swiper | 72af8f337fb18d9d18ab740ef3be1011ca188f40 | [
"MIT"
] | null | null | null | import os
from celery import Celery
from worker import config
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "swiper.settings")
celery_app = Celery('swiper')
celery_app.config_from_object(config)
celery_app.autodiscover_tasks()
def call_by_worker(func):
'''在celery中对任务进行异步调用'''
task = celery_app.task(fun... | 18.157895 | 66 | 0.771014 |
d5cd7f0eedf379c433e7d5e49d770e4f2fbd90db | 867 | py | Python | lookup_plugins/2/aws_vpc_id_from_name.py | Voronenko/ansible_lookups | b3557f1aa599b242fcb6a5dfba4bf4f11fc07fb6 | [
"MIT"
] | null | null | null | lookup_plugins/2/aws_vpc_id_from_name.py | Voronenko/ansible_lookups | b3557f1aa599b242fcb6a5dfba4bf4f11fc07fb6 | [
"MIT"
] | null | null | null | lookup_plugins/2/aws_vpc_id_from_name.py | Voronenko/ansible_lookups | b3557f1aa599b242fcb6a5dfba4bf4f11fc07fb6 | [
"MIT"
] | null | null | null | """
Description: This lookup takes an AWS region and a vpc
name and returns a matching VPC ID.
Example Usage:
{{ lookup('aws_vpc_id_from_name', 'eu-west-1', 'vpc1') }}
"""
from __future__ import (absolute_import, division, print_function)
from ansible.errors import AnsibleError
from ansible.plugins.lookup import Lookup... | 28.9 | 90 | 0.697809 |
734adc536c3a2df01516badd2d822dc0a1563737 | 3,583 | py | Python | pypy/objspace/std/test/test_stdobjspace.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/objspace/std/test/test_stdobjspace.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/objspace/std/test/test_stdobjspace.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import app2interp
from pypy.conftest import gettestobjspace
class TestW_StdObjSpace:
def test_wrap_wrap(self):
raises(TypeError,
self.space.wrap,
self.space.wrap(0))
def... | 38.117021 | 73 | 0.648898 |
d21a4d9af0f45e3db016d0a360d22412cd0e07bb | 1,359 | py | Python | generate_csv.py | 7own/FGT_Auditor | 923d2829069e00c548142a3425fcb57d6a987f3a | [
"MIT"
] | 2 | 2021-11-17T08:41:39.000Z | 2021-11-23T08:38:15.000Z | generate_csv.py | 7own/FGT_Auditor | 923d2829069e00c548142a3425fcb57d6a987f3a | [
"MIT"
] | null | null | null | generate_csv.py | 7own/FGT_Auditor | 923d2829069e00c548142a3425fcb57d6a987f3a | [
"MIT"
] | 1 | 2021-12-20T18:47:03.000Z | 2021-12-20T18:47:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Script for exporting configuration files into CSV file
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from codecs import open
from os import path
import sys
import re
import csv
import os
# ... | 29.543478 | 120 | 0.57248 |
52b0a4fb52faddab0781f772dd0ee728b2438375 | 982 | py | Python | geminidr/gmos/recipes/qa/recipes_FLAT_IMAGE.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 19 | 2017-10-23T14:52:51.000Z | 2022-03-28T04:49:00.000Z | geminidr/gmos/recipes/qa/recipes_FLAT_IMAGE.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 194 | 2017-11-01T17:32:45.000Z | 2022-03-31T21:32:59.000Z | geminidr/gmos/recipes/qa/recipes_FLAT_IMAGE.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 16 | 2017-11-01T05:18:04.000Z | 2021-12-14T23:08:57.000Z | """
Recipes available to data with tags ['GMOS', 'IMAGE', 'CAL', 'FLAT']
Default is "makeProcessedFlat".
"""
recipe_tags = {'GMOS', 'IMAGE', 'CAL', 'FLAT'}
def makeProcessedFlat(p):
"""
This recipe performs the standardization and corrections needed to
convert the raw input flat images into a single stacke... | 27.277778 | 74 | 0.679226 |
9f3147e5deb400f8d3eaa6029956049bcf600e47 | 9,861 | py | Python | Wrapping/Python/vtk/gtk/GtkGLExtVTKRenderWindowInteractor.py | Lin1225/vtk_v5.10.0 | b54ac74f4716572862365fbff28cd0ecb8d08c3d | [
"BSD-3-Clause"
] | 3 | 2020-06-20T23:31:06.000Z | 2021-01-11T02:17:16.000Z | Wrapping/Python/vtk/gtk/GtkGLExtVTKRenderWindowInteractor.py | Lin1225/vtk_v5.10.0 | b54ac74f4716572862365fbff28cd0ecb8d08c3d | [
"BSD-3-Clause"
] | 1 | 2020-12-01T23:21:02.000Z | 2020-12-02T23:44:43.000Z | Wrapping/Python/vtk/gtk/GtkGLExtVTKRenderWindowInteractor.py | Lin1225/vtk_v5.10.0 | b54ac74f4716572862365fbff28cd0ecb8d08c3d | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | """
Description:
Provides a pyGtk vtkRenderWindowInteractor widget. This embeds a
vtkRenderWindow inside a GTK widget and uses the
vtkGenericRenderWindowInteractor for the event handling. This is
similar to GtkVTKRenderWindowInteractor.py.
The extensions here allow the use of gtkglext rather than gtkgl an... | 32.331148 | 74 | 0.610587 |
ff0174754724257f400eec27c6dd714f0707ff95 | 18,131 | py | Python | bookworm_utility.py | kobejohn/BookwormUtility | 415e5606ad73202307af5be57a817441c401c25a | [
"MIT"
] | null | null | null | bookworm_utility.py | kobejohn/BookwormUtility | 415e5606ad73202307af5be57a817441c401c25a | [
"MIT"
] | 2 | 2017-09-01T12:32:30.000Z | 2018-03-17T02:57:02.000Z | bookworm_utility.py | kobejohn/BookwormUtility | 415e5606ad73202307af5be57a817441c401c25a | [
"MIT"
] | 2 | 2021-02-06T04:55:14.000Z | 2021-07-10T21:06:24.000Z | import os
from collections import OrderedDict
from time import sleep
from functools import partial
import autoconfig
import image_to_data
import anagram_solver
import tile
import flexframe
import simpleui
class BookwormUtility:
'''
Provides lists of words based on the letter tiles provided in the game
... | 46.252551 | 130 | 0.544206 |
e67f89a4c3d43adaff4fdd3554e648f93de8facd | 4,666 | py | Python | Unpublished/TensorflowPlayground/mnist.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | Unpublished/TensorflowPlayground/mnist.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | Unpublished/TensorflowPlayground/mnist.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | # %% [markdown]
# # Fitting ConvNN to Datasets
# MNIST/EMNIST
# Explore layers with NN microscope
# Add data augmentation
# %%
import tensorflow as tf
import tensorflow_datasets as tfds
import os
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("seaborn-whitegrid")
# %% Load data from csv
import pand... | 24.176166 | 101 | 0.637377 |
ee5c5396f4c3a86c241eecab8cf3a660dbba366f | 1,066 | py | Python | slothql/utils/tests/attr.py | karol-gruszczyk/sloth-gql | 7972adb761b60f14409c2f734473c0a04b8db63c | [
"MIT"
] | 2 | 2018-02-09T19:12:00.000Z | 2018-04-13T01:50:15.000Z | slothql/utils/tests/attr.py | karol-gruszczyk/sloth-gql | 7972adb761b60f14409c2f734473c0a04b8db63c | [
"MIT"
] | 29 | 2018-02-02T01:07:07.000Z | 2018-05-28T23:04:28.000Z | slothql/utils/tests/attr.py | IndioInc/slothql | 64a574013e249968746044555bd8779ac353b13f | [
"MIT"
] | null | null | null | from ..attr import is_magic_name, get_attrs, get_attr_fields
def test_magic_name__magic_method():
assert is_magic_name('__foo__')
def test_magic_name__startswith_dunder():
assert not is_magic_name('__bar')
def test_magic_name__endswith_dunder():
assert not is_magic_name('baz__')
def test_magic_name_... | 22.208333 | 92 | 0.574109 |
4eba126ff1947067f934e942f6a2ece25c0baeba | 3,240 | py | Python | tests/test_setup_py.py | roksys/license-changer | ba11744b200e8237f72da600abf97d6a29623dfa | [
"MIT"
] | null | null | null | tests/test_setup_py.py | roksys/license-changer | ba11744b200e8237f72da600abf97d6a29623dfa | [
"MIT"
] | null | null | null | tests/test_setup_py.py | roksys/license-changer | ba11744b200e8237f72da600abf97d6a29623dfa | [
"MIT"
] | null | null | null | from utils import update_setup_py, update_setup_py_invenio_dev_deps
from textwrap import dedent
def test_pypy_classifier():
text1 = """\
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation ... | 36.404494 | 76 | 0.535802 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.