hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d5912b94971243e8c9cbdfa09d986f96efc41aa9 | 3,577 | py | Python | experiments/ashvin/icml2020/hand/sparse/mc3.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/sparse/mc3.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/sparse/mc3.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies import GaussianP... | 30.57265 | 130 | 0.572267 |
d5913ab57469b77742e49a50188e808f701a8e73 | 970 | py | Python | mnist/trainfc.py | danny-1k/nnpy | d6ab503ca92e8eb84de061f66f646a932686cfab | [
"MIT"
] | null | null | null | mnist/trainfc.py | danny-1k/nnpy | d6ab503ca92e8eb84de061f66f646a932686cfab | [
"MIT"
] | null | null | null | mnist/trainfc.py | danny-1k/nnpy | d6ab503ca92e8eb84de061f66f646a932686cfab | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
import nnpy.nn as nn
from nnpy.optim import Adam,SGD
from model import FC
from torchvision import transforms
import torchvision.datasets as datasets
from torch.utils.data import DataLoader
import numpy as np
trans = transforms.Compose(
[
lambda x:np.asarray(x),
... | 19.795918 | 61 | 0.679381 |
d5915a2ad6d7c4b608bf24b7042a842b553ee8b9 | 3,505 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.364865 | 125 | 0.693581 |
d5916697df51cb58b9d59e8c15f24091bd5b8a62 | 633 | py | Python | recommender/core/extensions.py | abhishekpathak/recommendation-system | b91961f2baa2ab70626aaadad2f90f609c92a449 | [
"MIT"
] | null | null | null | recommender/core/extensions.py | abhishekpathak/recommendation-system | b91961f2baa2ab70626aaadad2f90f609c92a449 | [
"MIT"
] | null | null | null | recommender/core/extensions.py | abhishekpathak/recommendation-system | b91961f2baa2ab70626aaadad2f90f609c92a449 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import redis
from core import config
from core.datasources.movielens_source import MovieLensSource
from core.warehouse import FileWarehouse
""" Various global objects that can be loaded on demand"""
redis_conn = redis.StrictRedis(host=config.REDIS_HOST, port=config.REDIS_PORT)
_source = Mov... | 31.65 | 78 | 0.695103 |
d591c1e34512e989090c92c058489f8f4c887307 | 1,758 | py | Python | tests/unit/fake_data_root/kubernetes/var/lib/juju/agents/unit-kubernetes-master-0/charm/reactive/vaultlocker.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 6 | 2021-10-01T19:46:14.000Z | 2022-03-31T17:05:08.000Z | tests/unit/fake_data_root/kubernetes/var/lib/juju/agents/unit-kubernetes-master-0/charm/reactive/vaultlocker.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 111 | 2021-10-01T18:18:17.000Z | 2022-03-29T12:23:20.000Z | tests/unit/fake_data_root/kubernetes/var/lib/juju/agents/unit-kubernetes-master-0/charm/reactive/vaultlocker.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 10 | 2021-09-29T14:47:54.000Z | 2022-03-18T14:52:16.000Z | import shutil
from charms.reactive import when_all, when_not, set_flag, clear_flag
from charmhelpers.core import hookenv, host
from charms import apt
from charms import layer
@when_not('apt.installed.vaultlocker')
def install_vaultlocker():
'''Install vaultlocker.
On bionic and higher, vaultlocker is avail... | 35.16 | 79 | 0.719568 |
d591cbee3adede0f6e25605b1965987308d20873 | 210 | py | Python | PyTMX-3.19.0/pytmx/__init__.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | PyTMX-3.19.0/pytmx/__init__.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | PyTMX-3.19.0/pytmx/__init__.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | from .pytmx import *
from .tmxloader import load_pygame
__version__ = (3, 19, 0)
__author__ = 'bitcraft'
__author_email__ = 'leif.theden@gmail.com'
__description__ = 'Map loader for TMX Files - Python 2 and 3' | 30 | 61 | 0.752381 |
d591d64219810b51fa6aecd86fb31a9de343d356 | 2,586 | py | Python | other_stuff/curses-practice.py | PuuKala/My_random_stuff | 4564f79e97feb9d03bf9337fb2126dc22c2f1439 | [
"WTFPL"
] | null | null | null | other_stuff/curses-practice.py | PuuKala/My_random_stuff | 4564f79e97feb9d03bf9337fb2126dc22c2f1439 | [
"WTFPL"
] | null | null | null | other_stuff/curses-practice.py | PuuKala/My_random_stuff | 4564f79e97feb9d03bf9337fb2126dc22c2f1439 | [
"WTFPL"
] | null | null | null | # Copied from gitst.github.com/claymcleod -> pycurses.py
import curses
def menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Init/set colors
curses.start_color()
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
curses.in... | 29.386364 | 78 | 0.558005 |
d59203938cd6a2ea74e829eaae74fa143bb615f1 | 7,638 | py | Python | tests/test_percentage.py | mitchellkrogza/PyFunceble | b2b0d3fc18097cd630eed849ee99d961263d607b | [
"MIT"
] | null | null | null | tests/test_percentage.py | mitchellkrogza/PyFunceble | b2b0d3fc18097cd630eed849ee99d961263d607b | [
"MIT"
] | null | null | null | tests/test_percentage.py | mitchellkrogza/PyFunceble | b2b0d3fc18097cd630eed849ee99d961263d607b | [
"MIT"
] | null | null | null | # pylint:disable=line-too-long
"""
The tool to check the availability or syntax of domains, IPv4 or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██... | 30.674699 | 88 | 0.544383 |
d5920adbba1519ee21d64bad5f6fa9c422d550db | 2,038 | py | Python | dopamine/thesis/agents/DQVAgent.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | dopamine/thesis/agents/DQVAgent.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | dopamine/thesis/agents/DQVAgent.py | xqz-u/dopamine | d562750a58bcf681a6f8b590f4e4dfb263654b5e | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Tuple
import attr
import numpy as np
from jax import numpy as jnp
from thesis.agents import Agent, DQVMaxAgent, agent_utils
@attr.s(auto_attribs=True)
class DQVAgent(Agent.Agent):
@property
def model_names(self) -> Tuple[str]:
return ("vfunc", "qfunc")
@property
def ... | 31.353846 | 86 | 0.567223 |
d59217541d67364ccd1e1c8f007f67405d8bef7b | 7,288 | py | Python | evaluation/IJB/map_tools.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | null | null | null | evaluation/IJB/map_tools.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | null | null | null | evaluation/IJB/map_tools.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | null | null | null | from __future__ import print_function
from tqdm.auto import tqdm
import argparse
# import torch
# import torch.nn as nn
# import torch.nn.functional as F
# import torch.optim as optim
# from torchvision import datasets, transforms
# from torch.utils.data import Dataset, DataLoader, TensorDataset
# from torch.optim.lr_s... | 35.72549 | 191 | 0.576427 |
d592215b3c56f009fe639c79d518f1c794819e0d | 14,178 | py | Python | operator/helm/split_resources.py | pravingadakh/seldon-core | a72257fa851033ee09513a0b6b310087eb625e85 | [
"Apache-2.0"
] | null | null | null | operator/helm/split_resources.py | pravingadakh/seldon-core | a72257fa851033ee09513a0b6b310087eb625e85 | [
"Apache-2.0"
] | null | null | null | operator/helm/split_resources.py | pravingadakh/seldon-core | a72257fa851033ee09513a0b6b310087eb625e85 | [
"Apache-2.0"
] | null | null | null | import argparse
import glob
import re
import yaml
parser = argparse.ArgumentParser()
parser.add_argument('--prefix', default="xx", help='find files matching prefix')
parser.add_argument('--folder', required=True, help='Output folder')
args, _ = parser.parse_known_args()
HELM_SPARTAKUS_IF_START = '{{- if .Values.usage... | 62.184211 | 248 | 0.601707 |
d59242c7d93a781ba66ebba46a080b5a8e27c7e3 | 2,240 | py | Python | wsgi/youtube.py | AlexeyProskuryakov/rr | dcf598405159a48826f4214fa33abcf57418b680 | [
"MIT"
] | null | null | null | wsgi/youtube.py | AlexeyProskuryakov/rr | dcf598405159a48826f4214fa33abcf57418b680 | [
"MIT"
] | null | null | null | wsgi/youtube.py | AlexeyProskuryakov/rr | dcf598405159a48826f4214fa33abcf57418b680 | [
"MIT"
] | null | null | null | __author__ = 'alesha'
from apiclient.discovery import build
from apiclient.errors import HttpError
import re
duration_reg = re.compile(u"PT((?P<hours>\d+)H)?((?P<minutes>\d+)M)?((?P<seconds>\d+)S)?")
DEVELOPER_KEY = "AIzaSyALPCgnpIM6KcJsilUsi1VxO5A7xgLujPQ"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = ... | 33.432836 | 90 | 0.629464 |
d5925e1098be3e25d9214177da3b5fb3691c331e | 640 | py | Python | auth_service/urls.py | cedadev/django-authorizer | 88efa020defce86f50c72aab724cb5c4a34442f8 | [
"BSD-3-Clause"
] | 1 | 2020-02-26T02:16:46.000Z | 2020-02-26T02:16:46.000Z | auth_service/urls.py | cedadev/django-authorizer | 88efa020defce86f50c72aab724cb5c4a34442f8 | [
"BSD-3-Clause"
] | 10 | 2020-03-25T16:51:27.000Z | 2021-03-25T18:12:52.000Z | auth_service/urls.py | cedadev/django-authorizer | 88efa020defce86f50c72aab724cb5c4a34442f8 | [
"BSD-3-Clause"
] | 1 | 2021-07-01T09:51:19.000Z | 2021-07-01T09:51:19.000Z | """ URL configuration for the site. """
__author__ = "William Tucker"
__date__ = "2020-02-05"
__copyright__ = "Copyright 2020 United Kingdom Research and Innovation"
__license__ = "BSD - see LICENSE file in top-level package directory"
from django.urls import path
from .views import HomeView
from authorize.views im... | 29.090909 | 71 | 0.726563 |
d592755fb6c5249d6a3594f025eaa3e11a53b5ec | 8,825 | py | Python | atom/nucleus/python/nucleus_api/models/page_card_program.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/nucleus_api/models/page_card_program.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/nucleus_api/models/page_card_program.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from nucleus_api.configuration i... | 26.581325 | 194 | 0.57949 |
d59280ebc8347087d63b751b80bd9bc38e202f1f | 1,766 | py | Python | scripts/artifacts/etc_hosts.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/etc_hosts.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/etc_hosts.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | import codecs
from scripts.plugin_base import ArtefactPlugin
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv
from scripts import artifact_report
class EtcHostsPlugin(ArtefactPlugin):
"""
"""
def __init__(self):
super().__init__()
self.autho... | 35.32 | 112 | 0.593998 |
d59288a799805f624ca4dcd33cecc30c180cfd9f | 2,781 | py | Python | scripts/dtriac-19d/resources.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | scripts/dtriac-19d/resources.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | 26 | 2019-09-16T16:17:52.000Z | 2020-02-21T18:19:26.000Z | scripts/dtriac-19d/resources.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | import pickle
# pickled locations with coordinates, created by locations.py
LOCATIONS_INDEX = 'data/locations/locations.idx.pickle'
# list of common first names
FIRST_NAMES = 'data/names/common-first-names.txt'
class Names(object):
def __init__(self):
self.names_to_filter = set()
for line in o... | 33.107143 | 80 | 0.56886 |
d592891f1e272d99facd87bf578554d0eff2fd90 | 6,612 | py | Python | project-bikesharing/my_answers.py | smonasco/deep-learning-v2-pytorch | 6275d76769a3fab8dade518fb18d7c84ab7bb6a2 | [
"MIT"
] | null | null | null | project-bikesharing/my_answers.py | smonasco/deep-learning-v2-pytorch | 6275d76769a3fab8dade518fb18d7c84ab7bb6a2 | [
"MIT"
] | null | null | null | project-bikesharing/my_answers.py | smonasco/deep-learning-v2-pytorch | 6275d76769a3fab8dade518fb18d7c84ab7bb6a2 | [
"MIT"
] | null | null | null | import numpy as np
class NeuralNetwork(object):
def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):
# Set number of nodes in input, hidden and output layers.
self.input_nodes = input_nodes
self.hidden_nodes = hidden_nodes
self.output_nodes = output_nodes
... | 48.262774 | 141 | 0.639443 |
d592d2a212456fba448b07b6b7dce232a911f123 | 2,539 | py | Python | single_sender.py | NREL/bokeh-streaming | 096615cb425849f56f0e532bb1f707f8bf53bafe | [
"BSD-3-Clause"
] | 2 | 2020-04-01T17:31:29.000Z | 2021-09-14T07:35:23.000Z | single_sender.py | slavkomitic/bokeh-streaming | 096615cb425849f56f0e532bb1f707f8bf53bafe | [
"BSD-3-Clause"
] | null | null | null | single_sender.py | slavkomitic/bokeh-streaming | 096615cb425849f56f0e532bb1f707f8bf53bafe | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019 Alliance for Sustainable Energy, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# li... | 35.263889 | 80 | 0.713667 |
d592fa2ddcfe86756310e9bce6aac910f201e83b | 944 | py | Python | {{cookiecutter.project_slug}}/app/schemas/user.py | andredias/cookiecutter-fastapi | b5df6f80908d924e51a02fba34d1a01ccf4fc265 | [
"MIT"
] | 8 | 2021-06-12T10:11:03.000Z | 2022-03-23T13:27:23.000Z | {{cookiecutter.project_slug}}/app/schemas/user.py | andredias/cookiecutter-fastapi | b5df6f80908d924e51a02fba34d1a01ccf4fc265 | [
"MIT"
] | 12 | 2021-06-08T22:58:30.000Z | 2022-02-22T15:43:10.000Z | {{cookiecutter.project_slug}}/app/schemas/user.py | andredias/cookiecutter-fastapi | b5df6f80908d924e51a02fba34d1a01ccf4fc265 | [
"MIT"
] | 2 | 2021-08-10T22:55:49.000Z | 2021-08-10T23:05:29.000Z | import json
from typing import Optional
from pydantic import BaseModel, EmailStr, validator
from ..config import PASSWORD_MIN_LENGTH, PASSWORD_MIN_VARIETY
def check_password(password: str) -> str:
errors = []
if len(password) < PASSWORD_MIN_LENGTH:
errors.append(f'Password length < {PASSWORD_MIN_LEN... | 23.6 | 71 | 0.716102 |
d5931a4a1cbe78475f14e8231645fc451c7e106a | 5,679 | py | Python | core/argo/core/optimizers/SSA2Const.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | core/argo/core/optimizers/SSA2Const.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | core/argo/core/optimizers/SSA2Const.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | '''
DOCUMENTATION:
I have implemented the SSA 2 algorithms, given in:
https://arxiv.org/abs/1904.12952
Nesterov method with constant momentum factor is given in the work of Defazio:
https://arxiv.org/abs/1812.04634
See Table 1, page 3 - 'Modern Momentum' (here: beta is the momentum... | 50.256637 | 167 | 0.686565 |
d59339ac9c8a7e3e1d01efb2c06ab4c2a9b65c7b | 3,532 | py | Python | tests/functionality/seller_interactive.py | flamma7/csci5673_emarket | 44746f64212acbbaa36ca2c2d1974a9e1c003f83 | [
"MIT"
] | null | null | null | tests/functionality/seller_interactive.py | flamma7/csci5673_emarket | 44746f64212acbbaa36ca2c2d1974a9e1c003f83 | [
"MIT"
] | null | null | null | tests/functionality/seller_interactive.py | flamma7/csci5673_emarket | 44746f64212acbbaa36ca2c2d1974a9e1c003f83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Test functionality of sellers side
import sys
from emarket.client_seller import ClientSeller
from emarket.emarket import Item
import time
from os import environ as env
from dotenv import load_dotenv, find_dotenv
ENV_FILE = find_dotenv()
if ENV_FILE:
load_dotenv(ENV_FILE)
else:
raise Fil... | 32.109091 | 96 | 0.51359 |
d5933a5312ef96eaf06332664f9cb79e87dd32cb | 59,980 | py | Python | src/graph/__init__.py | olivier-boesch/spectro | d4fa17363c7ad305dbac55334b70ee49e9105906 | [
"MIT"
] | 2 | 2019-02-21T12:27:46.000Z | 2019-03-05T08:13:54.000Z | src/graph/__init__.py | olivier-boesch/spectro | d4fa17363c7ad305dbac55334b70ee49e9105906 | [
"MIT"
] | null | null | null | src/graph/__init__.py | olivier-boesch/spectro | d4fa17363c7ad305dbac55334b70ee49e9105906 | [
"MIT"
] | null | null | null | '''
Graph
======
The :class:`Graph` widget is a widget for displaying plots. It supports
drawing multiple plot with different colors on the Graph. It also supports
axes titles, ticks, labeled ticks, grids and a log or linear representation on
both the x and y axis, independently.
To display a plot. First create a gra... | 36.110777 | 104 | 0.567523 |
d59346d69b73787c8b8af9783df34411c0d6c3e6 | 12,785 | py | Python | homeworks/hw01.py | williamtrang/DSC20 | eb72c1003ee98e30f63040568e82eedcb8d3af52 | [
"Apache-2.0"
] | null | null | null | homeworks/hw01.py | williamtrang/DSC20 | eb72c1003ee98e30f63040568e82eedcb8d3af52 | [
"Apache-2.0"
] | null | null | null | homeworks/hw01.py | williamtrang/DSC20 | eb72c1003ee98e30f63040568e82eedcb8d3af52 | [
"Apache-2.0"
] | null | null | null | """
DSC 20 Homework 01
Name: William Trang (failure to write name or pid will be penalized)
PID: A16679845
"""
# Question 1
def unlucky_number(numbers):
"""
# Takes in a list of numbers and adds the elements up.
# Returns True if '4' is in the calculated sum and False if not.
>>> unlucky_number([1,2,3... | 31.9625 | 79 | 0.565037 |
d59357acf22380be6d08827e781497b2da36de5e | 2,374 | py | Python | main.py | Tammie-Li/DRL | 1ce8e9c45d2481a683b97fd6d2c05471eb9db1ca | [
"Apache-2.0"
] | null | null | null | main.py | Tammie-Li/DRL | 1ce8e9c45d2481a683b97fd6d2c05471eb9db1ca | [
"Apache-2.0"
] | null | null | null | main.py | Tammie-Li/DRL | 1ce8e9c45d2481a683b97fd6d2c05471eb9db1ca | [
"Apache-2.0"
] | null | null | null | import json
import torch
import torch.nn as nn
import torch.optim as optim
from Data.load_data import *
from task import *
from model import *
from Utils.evaluate import *
from Utils.record import *
if torch.cuda.is_available():
torch.backends.cudnn.deterministic = True
DEVICE = torch.device('cuda:0' if to... | 39.566667 | 122 | 0.663858 |
d5939cbc7457ab8e1de3dcf496ff34d26aad940b | 435 | py | Python | sp500forecaster/__init__.py | alessandrozamberletti/stock2image | 18feb2df586109c364e11e7ed64be01915093547 | [
"MIT"
] | 8 | 2018-11-06T21:39:05.000Z | 2022-02-17T08:37:17.000Z | sp500forecaster/__init__.py | alessandrozamberletti/stock2image | 18feb2df586109c364e11e7ed64be01915093547 | [
"MIT"
] | null | null | null | sp500forecaster/__init__.py | alessandrozamberletti/stock2image | 18feb2df586109c364e11e7ed64be01915093547 | [
"MIT"
] | 3 | 2018-10-21T08:41:36.000Z | 2019-03-14T18:17:13.000Z | import logging
from logging import NullHandler
def set_console_logger(level=logging.DEBUG, format_string="%(asctime)s %(name)s [%(levelname)s]: %(message)s"):
log.setLevel(level)
sh = logging.StreamHandler()
sh.setLevel(level)
formatter = logging.Formatter(format_string)
sh.setFormatter(formatter)... | 25.588235 | 111 | 0.733333 |
d593c2f6b3db76628f2d6a0176702d8a25bd1cc5 | 694 | py | Python | py/541. Reverse String II.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/541. Reverse String II.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/541. Reverse String II.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/reverse-string-ii/
# Given a string s and an integer k, reverse the first k characters for every 2k
# characters counting from the start of the string.
# If there are fewer than k characters left, reverse all of them. If there are
# less than 2k but greater than or equal to k character... | 34.7 | 82 | 0.583573 |
d593f609efe8f34e30cb3b54fa97a4cc2ddd0c93 | 615 | py | Python | terrascript/provider/alxrem/jsonnet.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/provider/alxrem/jsonnet.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/provider/alxrem/jsonnet.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/provider/alxrem/jsonnet.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:19:39 UTC)
import terrascript
class jsonnet(terrascript.Provider):
"""Terraform provider for generating JSON documents from Jsonnet templates"""
__description__ = (
"Terraform provider for generat... | 27.954545 | 81 | 0.718699 |
d594019ba70ae4df67cabd5f91d8c5af553f86d3 | 3,101 | py | Python | TdP_collections/priority_queue/adaptable_heap_priority_queue.py | giuseppemas/3gruppo_4_TDP | d85c5e232cbaa0a9a3512fdce906ea9fab7b1334 | [
"MIT"
] | null | null | null | TdP_collections/priority_queue/adaptable_heap_priority_queue.py | giuseppemas/3gruppo_4_TDP | d85c5e232cbaa0a9a3512fdce906ea9fab7b1334 | [
"MIT"
] | 1 | 2017-11-26T09:44:26.000Z | 2017-11-26T09:44:34.000Z | TdP_collections/priority_queue/adaptable_heap_priority_queue.py | giuseppemas/3gruppo_4_TDP | d85c5e232cbaa0a9a3512fdce906ea9fab7b1334 | [
"MIT"
] | null | null | null | # Copyright 2013, Michael H. Goldwasser
#
# Developed for use with the book:
#
# Data Structures and Algorithms in Python
# Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser
# John Wiley & Sons, 2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | 39.75641 | 85 | 0.613028 |
d5941ca93ed98e2a5ce0d1c3fd44f05141028212 | 11,232 | py | Python | autobuilder/ec2.py | Xeralux/autobuilder | 880a56ff12c578f4b002f18bee7338d7f7b006c0 | [
"MIT"
] | null | null | null | autobuilder/ec2.py | Xeralux/autobuilder | 880a56ff12c578f4b002f18bee7338d7f7b006c0 | [
"MIT"
] | null | null | null | autobuilder/ec2.py | Xeralux/autobuilder | 880a56ff12c578f4b002f18bee7338d7f7b006c0 | [
"MIT"
] | null | null | null | import re
import os
from buildbot.plugins import worker
from buildbot.worker import AbstractLatentWorker
import boto3
import botocore
from botocore.client import ClientError
class MyEC2LatentWorker(worker.EC2LatentWorker):
def __init__(self, name, password, instance_type, ami=None,
valid_ami_owne... | 45.473684 | 137 | 0.573095 |
d5941de181d766fe9b1b45b29107028645c7d1ae | 512 | py | Python | cloudmesh/pi/water.py | cloudmesh/cloudmesh.pi | bdf706b3763031341c41b811749064c293e73c14 | [
"Apache-2.0"
] | 2 | 2017-09-18T00:56:36.000Z | 2018-06-01T23:41:23.000Z | cloudmesh/pi/water.py | cloudmesh/cloudmesh-pi | bdf706b3763031341c41b811749064c293e73c14 | [
"Apache-2.0"
] | 1 | 2018-04-16T18:37:17.000Z | 2018-04-16T18:37:17.000Z | cloudmesh/pi/water.py | cloudmesh/cloudmesh.pi | bdf706b3763031341c41b811749064c293e73c14 | [
"Apache-2.0"
] | 3 | 2017-09-20T11:13:54.000Z | 2017-11-30T23:48:37.000Z | import time
import grovepi
class WaterSensor(object):
def __init__(self, pin=2):
"""
connect sensor to digital port. D2 is default.
:param pin: Number
"""
self.pin = pin
grovepi.pinMode(self.pin, "INPUT")
def get(self):
"""
gets the value measur... | 19.692308 | 54 | 0.564453 |
d5942a40b4b221b6e35d37a8038022e26c0b6cdd | 1,205 | py | Python | scripts/run_python_3_10.py | thomas-lehmann-private/queen | e17fdf432d06f8939d38b0de5eae1c651c1bc0b6 | [
"MIT"
] | null | null | null | scripts/run_python_3_10.py | thomas-lehmann-private/queen | e17fdf432d06f8939d38b0de5eae1c651c1bc0b6 | [
"MIT"
] | null | null | null | scripts/run_python_3_10.py | thomas-lehmann-private/queen | e17fdf432d06f8939d38b0de5eae1c651c1bc0b6 | [
"MIT"
] | null | null | null | import os
from runner import Runner
class ConcreteRunner(Runner):
""" Runner for Python 3.10 running Queen.py for multiple widths. """
PYTHON_VERSION = '3.10'
def __init__(self):
""" Initialize. """
self.logFileName = 'results/python_%s_%s.py.log' % (ConcreteRunner.PYTHON_VERSIO... | 37.65625 | 140 | 0.604149 |
d594a6d4b639876652444a1e1d5737f2a9ddc777 | 1,656 | py | Python | ulysses/etab1BE1F.py | earlyuniverse/ulysses | 9b8bade6d2d6badf2f17bac37306ea7ebceeeb4a | [
"MIT"
] | 9 | 2020-07-21T17:08:18.000Z | 2022-02-05T18:52:56.000Z | ulysses/etab1BE1F.py | earlyuniverse/ulysses | 9b8bade6d2d6badf2f17bac37306ea7ebceeeb4a | [
"MIT"
] | 2 | 2020-07-23T03:24:57.000Z | 2021-05-17T23:17:12.000Z | ulysses/etab1BE1F.py | earlyuniverse/ulysses | 9b8bade6d2d6badf2f17bac37306ea7ebceeeb4a | [
"MIT"
] | 1 | 2021-09-16T16:20:58.000Z | 2021-09-16T16:20:58.000Z | # non-resonant leptogenesis with one decaying sterile neutrino using the Boltzmann equations and neglecting flavour effects.
import ulysses
import numpy as np
from odeintw import odeintw
from ulysses.numba import jit
@jit
def fast_RHS(y0, d, w1, n1eq, epstt,epsmm,epsee):
N1 = y0[0]
NBL = y0[1]
r... | 28.551724 | 124 | 0.602657 |
d594dcbe541b0a48ad7cc7fb81ff6ffd6458b7d0 | 2,019 | py | Python | day06/day06.py | mpirnat/adventofcode | f63ce466b91d5be2687be95fd4ab0b442f1ea5c8 | [
"MIT"
] | 12 | 2015-12-02T05:56:36.000Z | 2017-11-29T18:58:47.000Z | day06/day06.py | mpirnat/adventofcode | f63ce466b91d5be2687be95fd4ab0b442f1ea5c8 | [
"MIT"
] | 1 | 2015-12-06T03:36:18.000Z | 2015-12-06T20:52:29.000Z | day06/day06.py | mpirnat/adventofcode | f63ce466b91d5be2687be95fd4ab0b442f1ea5c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Solve day 6 of Advent of Code.
http://adventofcode.com/day/6
"""
import re
class Part1:
def __init__(self, rows=1000, cols=1000, default=None):
self.grid = self.get_grid(rows, cols, default)
# This strategy of enumerating a full 1000x1000 2d array is probably a
# lit... | 23.206897 | 74 | 0.579495 |
d594f49481afc65d724729b4623ec70c67f0ca21 | 2,547 | py | Python | ertk/tensorflow/models/test_fit.py | bagustris/emotion | 5bd83d3ca8a6eb930f449b7a990fefd75d0c7d36 | [
"MIT"
] | 3 | 2020-11-03T14:54:22.000Z | 2021-04-12T12:23:10.000Z | ertk/tensorflow/models/test_fit.py | bagustris/emotion | 5bd83d3ca8a6eb930f449b7a990fefd75d0c7d36 | [
"MIT"
] | null | null | null | ertk/tensorflow/models/test_fit.py | bagustris/emotion | 5bd83d3ca8a6eb930f449b7a990fefd75d0c7d36 | [
"MIT"
] | 2 | 2020-12-03T06:21:59.000Z | 2021-01-16T04:47:12.000Z | from pathlib import Path
import click
import numpy as np
from . import get_tf_model
from ..utils import tf_dataset_mem, tf_dataset_gen, init_gpu_memory_growth
from ...utils import get_arg_mapping
@click.command()
@click.argument("model_name")
@click.option("--batch_size", type=int, default=32, help="Batch size.")
@... | 31.444444 | 87 | 0.682764 |
d594f9c42144fc3e696e6c6c0d6954ec514b39fb | 16,386 | py | Python | python/redmonster/application/zfind2.py | timahutchinson/redmonster | 73adfb20213b89e43b950eb6a7f6525f3d11cec4 | [
"CNRI-Python"
] | 5 | 2017-03-22T21:29:40.000Z | 2022-03-24T16:02:21.000Z | python/redmonster/application/zfind2.py | timahutchinson/redmonster | 73adfb20213b89e43b950eb6a7f6525f3d11cec4 | [
"CNRI-Python"
] | 4 | 2016-06-24T10:50:23.000Z | 2016-11-09T19:48:00.000Z | python/redmonster/application/zfind2.py | timahutchinson/redmonster | 73adfb20213b89e43b950eb6a7f6525f3d11cec4 | [
"CNRI-Python"
] | 6 | 2016-06-21T16:52:34.000Z | 2020-03-12T05:24:14.000Z | # Top level script to run redmonster as a whole.
#
# Required arguments:
# plate (int): 4-digit plate number
# mjd (int): 4-digit mjd for given plate
# templates (list of strings): List of template names, as strings, to be run, up to a max of 5. Template files must be in $REDMONSTER_DIR/templates/
#
# Optional argumen... | 45.390582 | 149 | 0.473575 |
d595081ab13560faf25637ab9e6d5ad7436ae3cc | 1,302 | py | Python | encoded_client/tests/test_sheet.py | detrout/encoded_client | 0cdd053ff5ef81f09e2310180cdc8808cff79151 | [
"BSD-3-Clause"
] | null | null | null | encoded_client/tests/test_sheet.py | detrout/encoded_client | 0cdd053ff5ef81f09e2310180cdc8808cff79151 | [
"BSD-3-Clause"
] | 1 | 2021-04-05T19:40:45.000Z | 2021-04-05T19:40:45.000Z | encoded_client/tests/test_sheet.py | detrout/encoded_client | 0cdd053ff5ef81f09e2310180cdc8808cff79151 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
import pandas
import tempfile
import pytest
from ..sheet import (
open_book,
save_book,
)
class TestSheet(TestCase):
def test_spreadsheet_wrappers(self):
pytest.importorskip("openpyxl")
sheet = pandas.DataFrame({
"uuid": ["fee130b0-aed1-4889-8703-... | 30.27907 | 95 | 0.580645 |
d59509a4ba8652fcefde14b1a2aee51ff9625ae4 | 3,252 | py | Python | sunpy/tests/runner.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/tests/runner.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/tests/runner.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import os
from astropy.tests.runner import TestRunner, keyword
class SunPyTestRunner(TestRunner):
"""
A runner for SunPy tests, it modifies the arguments to the astropy runner
to maintain a similar but more SunPy focused CLI.
"""
... | 27.559322 | 78 | 0.561808 |
d59510954e4894fbbc2df31816eb7253fb047f41 | 29,126 | py | Python | main.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | main.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | main.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia 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 applicable ... | 41.727794 | 115 | 0.731305 |
d5951577f7f58e9f83bd93b59306bfab0b9b1e3d | 2,164 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/input_chat_photo.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/input_chat_photo.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_chat_photo.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.362319 | 103 | 0.622458 |
d595224324dbe2e74c3b58fea5bb4f7fbc57e8d1 | 3,781 | py | Python | tests/test_1_GIS.py | naturalis/trait-geo-diverse-angiosperms | 034ce4e807f7a83d31bf7b46435275ba91cfcb00 | [
"MIT"
] | 13 | 2019-11-06T05:43:01.000Z | 2022-03-16T11:47:26.000Z | tests/test_1_GIS.py | naturalis/sdmdl | 034ce4e807f7a83d31bf7b46435275ba91cfcb00 | [
"MIT"
] | 249 | 2019-08-21T10:14:25.000Z | 2022-03-24T02:30:58.000Z | tests/test_1_GIS.py | naturalis/sdmdl | 034ce4e807f7a83d31bf7b46435275ba91cfcb00 | [
"MIT"
] | 8 | 2019-08-21T11:07:30.000Z | 2021-10-20T02:19:18.000Z | from sdmdl.sdmdl.gis import GIS
import unittest
import os
class GISTesCase(unittest.TestCase):
"""Test cases for Config Handler class."""
def setUp(self):
self.root = (os.path.abspath(os.path.join(os.path.dirname(__file__))) + '/test_data/root').replace('\\',
... | 41.097826 | 112 | 0.592171 |
d5952ed267dc9bc28793ec49a8b974c00a451ae5 | 5,447 | py | Python | openpype/hosts/maya/plugins/load/load_reference.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | openpype/hosts/maya/plugins/load/load_reference.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | openpype/hosts/maya/plugins/load/load_reference.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | import openpype.hosts.maya.api.plugin
from avalon import api, maya
from maya import cmds
import os
from openpype.api import get_project_settings
from openpype.lib import get_creator_by_name
class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
"""Load the model"""
families = ["model",
... | 34.916667 | 74 | 0.534423 |
d59544637586036426b99d78fe2f8fccfaf9cfde | 2,420 | py | Python | asn1editor/controller/Converter.py | AssaelDan/asn1editor | 8f4917ffe8c5fb8a4925c28239268583cbb6e742 | [
"MIT"
] | 5 | 2021-02-09T08:57:37.000Z | 2022-03-05T09:23:39.000Z | asn1editor/controller/Converter.py | Groops78/asn1editor | 1c386b3a34bcfccd97b80aa29c0ce4cfcb81853f | [
"MIT"
] | 24 | 2020-08-03T09:57:03.000Z | 2022-03-25T10:23:31.000Z | asn1editor/controller/Converter.py | Groops78/asn1editor | 1c386b3a34bcfccd97b80aa29c0ce4cfcb81853f | [
"MIT"
] | 2 | 2020-12-22T21:15:59.000Z | 2021-12-22T15:26:55.000Z | import typing
from datetime import date, time
class Converter:
def __init__(self, minimum: typing.Optional[typing.Union[int, float]], default: typing.Optional[typing.Union[str, bytes, int, float, date, time]]):
self._default = default
self._minimum = minimum
if self._minimum is None:
... | 24.693878 | 151 | 0.618182 |
d59545c337e923b9b8b0565184e74d9a3633a78f | 180,015 | py | Python | sdks/python/appcenter_sdk/api/crash_api.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/api/crash_api.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/api/crash_api.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import re # noqa: F401
# pytho... | 46.878906 | 406 | 0.630953 |
d5958b0f129ca9c928b34dd57c3c05e46edd0bd3 | 345 | py | Python | algopy/special/compound.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 54 | 2015-03-05T13:38:08.000Z | 2021-11-29T11:54:48.000Z | algopy/special/compound.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 7 | 2016-04-06T11:25:00.000Z | 2020-11-09T13:53:20.000Z | algopy/special/compound.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 13 | 2015-01-17T17:05:56.000Z | 2021-08-05T01:13:16.000Z | """
This file contains the implementation of functions
that are not represented as a single node in the
computational graph, but are
treated as a **compound** function.
Note
----
These functions should be replaced by a dedicated implementation in
* algopy.Function
* algopy.UTPM
so they are represented by a single n... | 18.157895 | 67 | 0.762319 |
d5959e23b26ff4209399ac186ca3b679d5bad8a8 | 2,256 | py | Python | set2/common.py | dineshkumarc987/matasano-crypto | a10dbd94ce0f5acb3a462a1a8d9bdb117729a206 | [
"MIT"
] | 25 | 2016-11-03T12:56:17.000Z | 2021-07-15T15:45:41.000Z | set2/common.py | dineshkumarc987/matasano-crypto | a10dbd94ce0f5acb3a462a1a8d9bdb117729a206 | [
"MIT"
] | null | null | null | set2/common.py | dineshkumarc987/matasano-crypto | a10dbd94ce0f5acb3a462a1a8d9bdb117729a206 | [
"MIT"
] | 7 | 2017-05-06T01:27:06.000Z | 2019-10-24T11:06:16.000Z | def randstr(n):
from random import randint
return ''.join(chr(randint(0, 255)) for _ in range(n))
def pad(data, blocksize=16):
l = (len(data) / blocksize + 1) * blocksize
m = l - len(data)
return data + chr(m) * m
def unpad(data, blocksize=16):
if len(data) % blocksize != 0:
raise Ex... | 26.857143 | 79 | 0.574911 |
d595b080f26dcbf457c3c17b57e34ff533f119e9 | 597 | py | Python | Sorting/counting_sort.py | luoshao23/ML_algorithm | 6e94fdd0718cd892118fd036c7c5851cf3e6d796 | [
"MIT"
] | 4 | 2017-06-19T06:33:38.000Z | 2019-01-31T12:07:12.000Z | Sorting/counting_sort.py | luoshao23/ML_algorithm | 6e94fdd0718cd892118fd036c7c5851cf3e6d796 | [
"MIT"
] | null | null | null | Sorting/counting_sort.py | luoshao23/ML_algorithm | 6e94fdd0718cd892118fd036c7c5851cf3e6d796 | [
"MIT"
] | 1 | 2017-12-06T08:41:06.000Z | 2017-12-06T08:41:06.000Z | def counting_sort(A, k):
"""
Counting sort: No comparison between elements
input: A[0:n] len(A)=n
output: B[0:n] len(B)=n
auxiliary: C[0:k] len(C)=k
"""
c=[0]*k
for a in A:
c[a] += 1
print c
for i in xrange(1, k):
c[i] = c[i] + c[i-1]
print c
B = [None fo... | 18.090909 | 49 | 0.474037 |
d595dd67895485243a590ed0f1abeccb61d95471 | 3,096 | py | Python | app/request.py | Pnshimiye/Self-Pitch | 2796c0146cee4a3e39a292b50977b1205c041dbf | [
"MIT"
] | null | null | null | app/request.py | Pnshimiye/Self-Pitch | 2796c0146cee4a3e39a292b50977b1205c041dbf | [
"MIT"
] | null | null | null | app/request.py | Pnshimiye/Self-Pitch | 2796c0146cee4a3e39a292b50977b1205c041dbf | [
"MIT"
] | null | null | null |
# import urllib.request,json
# from .models import Movie
# # Getting api key
# api_key = None
# # Getting the movie base url
# base_url = None
# def configure_request(app):
# global api_key,base_url
# api_key = app.config['MOVIE_API_KEY']
# base_url = app.config['MOVIE_API_BASE_URL']
# def get_movies... | 33.290323 | 115 | 0.664729 |
d595e3e220045c17faa48b306125a1bf51bba148 | 9,053 | py | Python | wechat_django/models/user.py | UltraVacuum/wechat-django | 0ea243067f5bc5e69cab6c4585d5e46d9399a583 | [
"MIT"
] | 166 | 2019-02-23T10:19:33.000Z | 2022-02-03T06:50:15.000Z | wechat_django/models/user.py | UltraVacuum/wechat-django | 0ea243067f5bc5e69cab6c4585d5e46d9399a583 | [
"MIT"
] | 19 | 2019-05-07T07:28:32.000Z | 2021-06-02T06:56:03.000Z | wechat_django/models/user.py | UltraVacuum/wechat-django | 0ea243067f5bc5e69cab6c4585d5e46d9399a583 | [
"MIT"
] | 54 | 2019-02-27T07:55:57.000Z | 2021-09-02T06:47:51.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from django.db import models as m, transaction
from django.utils import timezone as tz
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import cached_property
from wechatpy.constants import WeChatErrorCode
fr... | 35.225681 | 84 | 0.585552 |
d5963d5d1f08694c92fc079be75736c47b12ee4d | 10,925 | py | Python | python/pyclaw/evolve/solver.py | geoflows/geoclaw-4.x | c8879d25405017b38392aa3b1ea422ff3e3604ea | [
"BSD-3-Clause"
] | 2 | 2016-04-26T02:32:09.000Z | 2021-02-08T08:43:44.000Z | python/pyclaw/evolve/solver.py | che-wenchao/D-Claw | 8ab5d971c9a7a7130e03a447a4b8642e292f4e88 | [
"BSD-3-Clause"
] | null | null | null | python/pyclaw/evolve/solver.py | che-wenchao/D-Claw | 8ab5d971c9a7a7130e03a447a4b8642e292f4e88 | [
"BSD-3-Clause"
] | 2 | 2019-01-17T04:34:08.000Z | 2020-08-11T16:02:28.000Z | #!/usr/bin/env python
# encoding: utf-8
r"""
Module specifying the interface to every solver in pyclaw.
:Authors:
Kyle T. Mandli (2008-08-19) Initial version
"""
# ============================================================================
# Copyright (C) 2008 Kyle T. Mandli <mandli@amath.washington.edu>
#
#... | 36.416667 | 89 | 0.522197 |
d5965003b55dc88072b83d4c22ae493d7e434b88 | 8,957 | py | Python | demonet/data/coco.py | zhiqwang/demonet | 8370fc41d56d28939403b883f4b4014172895781 | [
"Apache-2.0"
] | 11 | 2020-08-28T09:29:42.000Z | 2021-10-03T09:08:11.000Z | demonet/data/coco.py | vanillapi/demonet | 8370fc41d56d28939403b883f4b4014172895781 | [
"Apache-2.0"
] | 1 | 2020-05-01T14:57:57.000Z | 2020-05-01T17:59:40.000Z | demonet/data/coco.py | zhiqwang/demonet | 8370fc41d56d28939403b883f4b4014172895781 | [
"Apache-2.0"
] | 3 | 2020-04-15T07:53:13.000Z | 2020-05-18T18:51:31.000Z | """
COCO dataset which returns image_id for evaluation.
Mostly copy-paste from https://github.com/pytorch/vision/blob/master/references/detection/coco_utils.py
"""
import copy
import os
import torch
import torch.utils.data
import torchvision
from pycocotools import mask as coco_mask
from pycocotools.coco import COCO
... | 34.988281 | 103 | 0.617729 |
d596510c0b384dca72873b268c557fd4e2d54b63 | 4,013 | py | Python | oscar/lib/python2.7/site-packages/flake8/main/setuptools_command.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/flake8/main/setuptools_command.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/flake8/main/setuptools_command.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """The logic for Flake8's integration with setuptools."""
import os
import setuptools
from flake8.main import application as app
UNSET = object()
class Flake8(setuptools.Command):
"""Run Flake8 via setuptools/distutils for registered modules."""
description = 'Run Flake8 on modules registered... | 38.586538 | 78 | 0.597807 |
d5965431f87f234095effe04789237c2d47087ca | 447 | py | Python | api/migrations/0003_auto_20170326_1951.py | zserg/flashcard | 985b2966250d7719d8ff5575785e41b4d503eb8b | [
"MIT"
] | 12 | 2017-03-22T10:19:04.000Z | 2022-02-03T14:42:36.000Z | api/migrations/0003_auto_20170326_1951.py | zserg/flashcard | 985b2966250d7719d8ff5575785e41b4d503eb8b | [
"MIT"
] | 2 | 2017-04-13T15:15:02.000Z | 2018-11-26T17:53:23.000Z | api/migrations/0003_auto_20170326_1951.py | zserg/flashcard | 985b2966250d7719d8ff5575785e41b4d503eb8b | [
"MIT"
] | 9 | 2017-04-10T22:35:27.000Z | 2022-02-21T16:38:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-26 16:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_auto_20170308_1949'),
]
operations = [
migrations.AlterField(
... | 21.285714 | 48 | 0.608501 |
d596670737b58e8f3e0aed735bb0cf5ce8ac047a | 1,918 | py | Python | src/schemathesis/runner/events.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | null | null | null | src/schemathesis/runner/events.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | null | null | null | src/schemathesis/runner/events.py | chr1st1ank/schemathesis | f2e160d56c1fdce9eac7fee5875b209c8944f54a | [
"MIT"
] | null | null | null | import os
import shutil
import time
from typing import Callable, Iterable, List
import attr
import hypothesis
from ..models import Endpoint, Status, TestResultSet
from ..schemas import BaseSchema
@attr.s(slots=True) # pragma: no mutate
class ExecutionContext:
"""Storage for the current context of the execution... | 31.966667 | 100 | 0.716371 |
d5966b987061ade9f0e114f4df9062665ba5c3f8 | 2,032 | py | Python | tl/cli/get-fuzzy-matches.py | mtang724/table-linker | 67201fa3c35df244750892155239cafe4085e15a | [
"MIT"
] | null | null | null | tl/cli/get-fuzzy-matches.py | mtang724/table-linker | 67201fa3c35df244750892155239cafe4085e15a | [
"MIT"
] | null | null | null | tl/cli/get-fuzzy-matches.py | mtang724/table-linker | 67201fa3c35df244750892155239cafe4085e15a | [
"MIT"
] | null | null | null | import sys
import argparse
import traceback
import tl.exceptions
def parser():
return {
'help': 'retrieves the identifiers of KG entities whose label or aliases match the input values exactly.'
}
def add_arguments(parser):
"""
Parse Arguments
Args:
parser: (argparse.ArgumentParse... | 40.64 | 128 | 0.64124 |
d59672ee271e32a1f8af903fac329bb068a74c02 | 2,068 | py | Python | src/augraphy/base/oneof.py | faizan1041/augraphy | 9ea0502516606f1bc73b4067b18955308b7c6332 | [
"MIT"
] | null | null | null | src/augraphy/base/oneof.py | faizan1041/augraphy | 9ea0502516606f1bc73b4067b18955308b7c6332 | [
"MIT"
] | null | null | null | src/augraphy/base/oneof.py | faizan1041/augraphy | 9ea0502516606f1bc73b4067b18955308b7c6332 | [
"MIT"
] | null | null | null | import numpy as np
import random
from augraphy.base.augmentation import Augmentation
from augraphy.base.augmentationsequence import AugmentationSequence
from augraphy.base.augmentation import Augmentation
class OneOf(Augmentation):
"""Given a list of Augmentations, selects one to apply.
:param augmentations:... | 34.466667 | 87 | 0.676015 |
d59689010f0977433d6f8139da9db15abee46e91 | 1,664 | py | Python | do_aramco_interp.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | do_aramco_interp.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | do_aramco_interp.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | 1 | 2022-02-11T23:22:41.000Z | 2022-02-11T23:22:41.000Z | import os
import numpy as np
datafolder="/home/jliu447/lossycompression/aramco"
#ebs=[i*1e-4 for i in range(1,10)]+[i*1e-3 for i in range(1,10)]+[i*1e-2 for i in range(1,11)]
ebs=[1e-3]
cr=np.zeros((29,11),dtype=np.float32)
psnr=np.zeros((29,11),dtype=np.float32)
ctime=np.zeros((29,11),dtype=np.float32)
dtime=np.zer... | 32.627451 | 94 | 0.565505 |
d596a7b90fa4e242d49c00096cad9d66dbc56743 | 1,635 | py | Python | backup_selected_image.py | sandalon/iphone-image-backup | c3163f444429faa7b9c62da21633c6404a24bf58 | [
"MIT"
] | null | null | null | backup_selected_image.py | sandalon/iphone-image-backup | c3163f444429faa7b9c62da21633c6404a24bf58 | [
"MIT"
] | null | null | null | backup_selected_image.py | sandalon/iphone-image-backup | c3163f444429faa7b9c62da21633c6404a24bf58 | [
"MIT"
] | null | null | null | import paramiko
import photos
import dialogs
import os
import json
from objc_util import *
host = ''
port = 22
username = ''
password = ''
if os.path.isfile('settings.json'):
with open('settings.json') as in_file:
login_creds = json.load(in_file)
if login_creds is not None:
host = login_creds.get('host')
user... | 27.711864 | 89 | 0.699694 |
d596ca0f24e401e2964833f43d7d3144265e0809 | 6,454 | py | Python | app/workers/webhook_transfer.py | brotskydotcom/public-services.py | 5cb0b57cb8f1c9d5b3e907cf27a6a560cbfe0020 | [
"MIT"
] | null | null | null | app/workers/webhook_transfer.py | brotskydotcom/public-services.py | 5cb0b57cb8f1c9d5b3e907cf27a6a560cbfe0020 | [
"MIT"
] | 46 | 2020-07-19T05:02:36.000Z | 2020-12-13T18:32:47.000Z | app/workers/webhook_transfer.py | brotskydotcom/public-services.py | 5cb0b57cb8f1c9d5b3e907cf27a6a560cbfe0020 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Daniel C. Brotsky
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | 39.595092 | 88 | 0.649985 |
d596d6a5f07eaedeb2e839232835abfc2e404feb | 84 | py | Python | exome_slicer/graphql/mixins.py | genomics-geek/exome_slicer | e1e69fac4ec634b07bab353a191ce783ec766c53 | [
"MIT"
] | 2 | 2018-04-09T14:09:59.000Z | 2019-09-24T08:27:23.000Z | exome_slicer/graphql/mixins.py | genomics-geek/exome_slicer | e1e69fac4ec634b07bab353a191ce783ec766c53 | [
"MIT"
] | 4 | 2018-01-24T18:41:20.000Z | 2018-12-07T16:41:09.000Z | exome_slicer/graphql/mixins.py | genomics-geek/exome_slicer | e1e69fac4ec634b07bab353a191ce783ec766c53 | [
"MIT"
] | 1 | 2018-01-17T23:56:52.000Z | 2018-01-17T23:56:52.000Z | from graphene import Int
class PrimaryKeyMixin(object):
pk = Int(source='pk')
| 14 | 30 | 0.714286 |
d596e6e5abc67fe02b8c056fd4441f716fed3f34 | 11,312 | py | Python | src/morpheus/core/Morpheus.py | eliavw/morpheus | 01c6d15416188254cfdcc7fe9461069cbf8dbe63 | [
"MIT"
] | null | null | null | src/morpheus/core/Morpheus.py | eliavw/morpheus | 01c6d15416188254cfdcc7fe9461069cbf8dbe63 | [
"MIT"
] | null | null | null | src/morpheus/core/Morpheus.py | eliavw/morpheus | 01c6d15416188254cfdcc7fe9461069cbf8dbe63 | [
"MIT"
] | null | null | null | import numpy as np
from inspect import signature
import warnings
from networkx import NetworkXUnfeasible
from sklearn.impute import SimpleImputer
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
import morpheus.algo.sele... | 30.327078 | 108 | 0.605817 |
d59704cae763f40604d2b7614e6b801d2c305058 | 6,274 | py | Python | dataloader/Dataloader_webvision.py | lisenbuaa/RRL | 5db0d753486de1518af1077c6ef2121da41486f8 | [
"BSD-3-Clause"
] | 4 | 2021-11-26T09:15:00.000Z | 2022-01-11T06:29:57.000Z | dataloader/Dataloader_webvision.py | lisenbuaa/RRL | 5db0d753486de1518af1077c6ef2121da41486f8 | [
"BSD-3-Clause"
] | null | null | null | dataloader/Dataloader_webvision.py | lisenbuaa/RRL | 5db0d753486de1518af1077c6ef2121da41486f8 | [
"BSD-3-Clause"
] | 3 | 2021-12-15T16:12:44.000Z | 2022-03-14T01:31:58.000Z | from torch.utils.data import Dataset, DataLoader
import torchvision.transforms as transforms
import random
import numpy as np
from PIL import Image
import torch
import os
from PIL import ImageFile
import augmentations
augmentations.IMAGE_SIZE = 299
ImageFile.LOAD_TRUNCATED_IMAGES = True
class imagenet_dataset(Dataset... | 39.459119 | 153 | 0.550526 |
d5974a6316d90f0338746e676a7b6415a2d20c64 | 2,831 | py | Python | irida_uploader_cl/parsers/miseq/validation.py | duanjunhyq/irida_uploader_cl | d0e5d404c5b5b10c3411ded71a20f5ab062aabba | [
"MIT"
] | null | null | null | irida_uploader_cl/parsers/miseq/validation.py | duanjunhyq/irida_uploader_cl | d0e5d404c5b5b10c3411ded71a20f5ab062aabba | [
"MIT"
] | null | null | null | irida_uploader_cl/parsers/miseq/validation.py | duanjunhyq/irida_uploader_cl | d0e5d404c5b5b10c3411ded71a20f5ab062aabba | [
"MIT"
] | null | null | null | from irida_uploader_cl.parsers import exceptions
from irida_uploader_cl.parsers.miseq.sample_parser import get_csv_reader
import irida_uploader_cl.model as model
def validate_sample_sheet(sample_sheet_file):
"""
Checks if the given sample_sheet_file can be parsed
Requires [Header] because it contains Wor... | 34.108434 | 120 | 0.661604 |
d597897330af239d7f69d844827e2291b7d11faa | 2,235 | py | Python | plugins/usd/houdini/publish/extract_fx_layer.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 3 | 2020-04-01T10:51:17.000Z | 2021-08-05T18:35:23.000Z | plugins/usd/houdini/publish/extract_fx_layer.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | null | null | null | plugins/usd/houdini/publish/extract_fx_layer.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 1 | 2020-07-05T12:06:30.000Z | 2020-07-05T12:06:30.000Z | import os
import traceback
import pyblish.api
class ExtractFxLayerUSD(pyblish.api.InstancePlugin):
order = pyblish.api.ExtractorOrder + 0.2
label = "Extract Fx Layer USD Export"
# hosts = ["houdini"]
families = [
"reveries.fx.layer_prim",
]
def process(self, instance):
from ... | 30.616438 | 80 | 0.603132 |
d5978ab3c76da6d01b82db22f1adcf0f2a8b58d0 | 4,856 | py | Python | src/data/aDataLoadAndCleaningHistorical.py | sebastian-konicz/WRM | e60aafada7bb85df955a7e1357f33fe5846f4e6c | [
"MIT"
] | 1 | 2019-11-02T18:24:19.000Z | 2019-11-02T18:24:19.000Z | src/data/aDataLoadAndCleaningHistorical.py | sebastian-konicz/WRM | e60aafada7bb85df955a7e1357f33fe5846f4e6c | [
"MIT"
] | 7 | 2020-03-24T17:48:28.000Z | 2022-03-12T00:05:13.000Z | src/data/aDataLoadAndCleaningHistorical.py | sebastian-konicz/WRM | e60aafada7bb85df955a7e1357f33fe5846f4e6c | [
"MIT"
] | null | null | null | import pandas as pd
from pathlib import Path
import geopy.distance as gd
pd.options.display.max_columns = 50
def main(dir, dataYear):
# LOADING DATA FROM DIRECTORY
dataPath = dir + r'\data\interim'
print("Loading Datasets")
# Rental dataset
RentalData = pd.read_excel(dataPath + r'\RentalData{}.xls... | 49.55102 | 188 | 0.685338 |
d59795998bfb6044d618798709cd628d596c7e43 | 2,520 | py | Python | api_schema/api_schema.py | mmxmb/course-sched | 2de97797456f040280a9060fb71215e4f5cba1b0 | [
"MIT"
] | null | null | null | api_schema/api_schema.py | mmxmb/course-sched | 2de97797456f040280a9060fb71215e4f5cba1b0 | [
"MIT"
] | null | null | null | api_schema/api_schema.py | mmxmb/course-sched | 2de97797456f040280a9060fb71215e4f5cba1b0 | [
"MIT"
] | null | null | null | import dotenv
import os
from schema import Schema, And, Use, Optional
from dotenv import load_dotenv
load_dotenv()
PERIODS_RANGE = range(int(os.environ.get('PERIODS_PER_DAY', 27)))
MAX_SOLS = int(os.environ.get('API_MAX_N_SOLUTIONS', 999))
DAYS_RANGE = range(int(os.environ.get('DAYS_PER_WEEK', 5)))
WEEK_N_PERIODS = (... | 42.711864 | 86 | 0.490079 |
d597af2ad5815530a37962f022314cf940bddfc9 | 138,174 | py | Python | extlbx/convert.py | Template-Latex/Export-Subtemplate | 595bf76f5c94daffdba4fbb686d51cce7ad298c8 | [
"MIT"
] | 1 | 2017-08-02T02:54:53.000Z | 2017-08-02T02:54:53.000Z | extlbx/convert.py | Template-Latex/Export-Subtemplate | 595bf76f5c94daffdba4fbb686d51cce7ad298c8 | [
"MIT"
] | null | null | null | extlbx/convert.py | Template-Latex/Export-Subtemplate | 595bf76f5c94daffdba4fbb686d51cce7ad298c8 | [
"MIT"
] | null | null | null | """
CONVERT
Convierte los archivos y exporta versiones
Autor: Pablo Pizarro R. @ ppizarror.com
Licencia:
The MIT License (MIT)
Copyright 2017-2021 Pablo Pizarro R.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation fil... | 48.329486 | 134 | 0.592738 |
d597bc467a7bb885b39219759cbf1229e04dcca0 | 1,654 | py | Python | examples/skywriter/helloworld.py | JavQuiMor/solodevguide | 80e82984251d6eb2430f9aa106dbf297d480b1e8 | [
"CC-BY-4.0"
] | 40 | 2015-10-20T03:02:55.000Z | 2020-12-03T18:17:02.000Z | examples/skywriter/helloworld.py | JavQuiMor/solodevguide | 80e82984251d6eb2430f9aa106dbf297d480b1e8 | [
"CC-BY-4.0"
] | 236 | 2015-09-09T00:39:43.000Z | 2021-02-23T07:36:26.000Z | examples/skywriter/helloworld.py | JavQuiMor/solodevguide | 80e82984251d6eb2430f9aa106dbf297d480b1e8 | [
"CC-BY-4.0"
] | 69 | 2015-09-09T04:29:01.000Z | 2022-02-09T03:19:37.000Z | '''
helloworld.py
This program will draw 3DR in the sky. It is designed to be run onboard solo.
It utilizes SimpleDrone which allows for directional control using dronekit
Default size(scale = 1.0) is 4.4x2 meters. Change the scale factor to increase size.
Programming exercise:
Switch y and z axis to make a cool night ... | 23.971014 | 84 | 0.640266 |
d597d3b48b58c636b9abea00111eb4290bdafa6a | 2,599 | py | Python | src/oscar/apps/checkout/app.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/checkout/app.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/checkout/app.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from oscar.core.application import Application
from oscar.core.loading import get_class
class CheckoutApplication(Application):
name = 'checkout'
index_view = get_class('che... | 39.984615 | 80 | 0.604463 |
d59837901b23ef3c49ad3bc4763315d37c2ab806 | 798 | py | Python | rest_framework_jwt/utils.py | ardydedase/django-rest-framework-jwt | e730900ef21f26436f87c8fb865cf555d7af1647 | [
"MIT"
] | null | null | null | rest_framework_jwt/utils.py | ardydedase/django-rest-framework-jwt | e730900ef21f26436f87c8fb865cf555d7af1647 | [
"MIT"
] | null | null | null | rest_framework_jwt/utils.py | ardydedase/django-rest-framework-jwt | e730900ef21f26436f87c8fb865cf555d7af1647 | [
"MIT"
] | null | null | null | import datetime
import jwt
from rest_framework_jwt.settings import api_settings
def jwt_payload_handler(user):
try:
username = user.get_username()
except AttributeError:
username = user.username
return {
'user_id': user.id,
'email': user.email,
'username': username... | 22.166667 | 77 | 0.66416 |
d5987e70d743c11e673807e41e3a6f1a81801e25 | 12,982 | py | Python | violas_client/oracle_client/bytecodes.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/oracle_client/bytecodes.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/oracle_client/bytecodes.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from enum import IntEnum
from violas_client.lbrtypes.transaction.script import Script
from violas_client.lbrtypes.bytecode import gen_hex_hash
from violas_client.move_core_types.account_address import AccountAddress
from violas_client.lbrtypes.bytecode import CodeType as LibraCodeType
class CodeType(IntEnum):
ORA... | 127.27451 | 3,125 | 0.758435 |
d598b77cd796015b7a1878eae0683c0e1ce61fb7 | 6,834 | py | Python | src/file_renamer.py | poponealex/files_renamer | c714b9c7f96432801dff84d1158d7408780a590a | [
"MIT"
] | null | null | null | src/file_renamer.py | poponealex/files_renamer | c714b9c7f96432801dff84d1158d7408780a590a | [
"MIT"
] | 3 | 2021-04-22T14:51:09.000Z | 2022-01-22T17:53:37.000Z | src/file_renamer.py | poponealex/files_renamer | c714b9c7f96432801dff84d1158d7408780a590a | [
"MIT"
] | null | null | null | __import__("sys").path.extend(["..", "."])
import logging, re, subprocess, sys
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from datetime import datetime
from itertools import count, groupby
from pathlib import Path, PurePath
from src.file_system import FileSystem
from src.goodies import *
from temp... | 35.409326 | 128 | 0.653205 |
d598bf6a0b58a547e4eba2cb40991b068bdc5b2c | 5,733 | py | Python | src/wea/meta_data.py | casabre/WrappedExchangeArray.py | 856ca456a59708122503f258e00c0baa46fe0832 | [
"MIT"
] | null | null | null | src/wea/meta_data.py | casabre/WrappedExchangeArray.py | 856ca456a59708122503f258e00c0baa46fe0832 | [
"MIT"
] | 1 | 2021-05-18T20:40:19.000Z | 2021-05-18T20:40:19.000Z | src/wea/meta_data.py | casabre/wea.py | 856ca456a59708122503f258e00c0baa46fe0832 | [
"MIT"
] | null | null | null | """
Copyright(c) 2016: Éric Thiébaut https: // github.com/emmt
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files(the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, mer... | 36.987097 | 77 | 0.681319 |
d598c6529a25f3e5a81a594a8479804307d9ef74 | 1,701 | py | Python | app/core/migrations/0001_initial.py | neomodular/recipe-app-api | 43ffa6258f08e3685f3921d1314fdd90a946bb40 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | neomodular/recipe-app-api | 43ffa6258f08e3685f3921d1314fdd90a946bb40 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | neomodular/recipe-app-api | 43ffa6258f08e3685f3921d1314fdd90a946bb40 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-23 00:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... | 50.029412 | 266 | 0.637272 |
d598d5f55a617d62e62eb2acea60333b7e37f50b | 18,198 | py | Python | gui/text.py | pvyhnal-generalbytes/Electron-Cash-SLP | 0da284467e390ca92cd43c52d97cd0de5ad1292c | [
"MIT"
] | 6 | 2020-07-27T18:08:14.000Z | 2021-11-17T10:47:10.000Z | gui/text.py | tomasiCF/Electron-Cash-SLP | 0da284467e390ca92cd43c52d97cd0de5ad1292c | [
"MIT"
] | 96 | 2018-11-09T12:46:17.000Z | 2019-04-16T21:26:59.000Z | gui/text.py | tomasiCF/Electron-Cash-SLP | 0da284467e390ca92cd43c52d97cd0de5ad1292c | [
"MIT"
] | 4 | 2018-12-07T12:54:20.000Z | 2019-02-28T01:54:56.000Z | import tty, sys
import curses, datetime, locale
from decimal import Decimal as PyDecimal
import getpass
import electrum
from electroncash.address import Address
from electroncash.util import format_satoshis, set_verbosity
from electroncash.bitcoin import COIN, TYPE_ADDRESS
from electroncash import Wallet, WalletStorag... | 36.035644 | 151 | 0.530773 |
d598d61ee75cc38a80db094fb50ee71ac3d30dee | 3,990 | py | Python | venv/Lib/site-packages/pyrogram/raw/base/message_entity.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/base/message_entity.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/base/message_entity.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 58.676471 | 631 | 0.700752 |
d598f91d8b14083925d05d418d3a9a4e9cb2e784 | 96 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/user_agent/en_US/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/user_agent/en_US/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/user_agent/en_US/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from .. import Provider as UserAgentProvider
class Provider(UserAgentProvider):
pass
| 16 | 45 | 0.739583 |
d59927993debb6b454452c2f758b95292b447e86 | 11,247 | py | Python | pandas/tests/series/test_replace.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | 12 | 2015-02-13T06:55:58.000Z | 2020-06-22T19:02:52.000Z | pandas/tests/series/test_replace.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/series/test_replace.py | MaxVanDeursen/pandas | 9821b77de692716d7c2b62db1a68cac9ffc456c3 | [
"BSD-3-Clause"
] | 16 | 2015-01-24T07:42:41.000Z | 2021-07-06T21:13:39.000Z | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from .common import TestData
class TestSeriesReplace(TestData):
def test_replace(self):
N = 100
ser = pd.Series(np.random.randn(N))
ser[0:4] = np.nan
... | 36.163987 | 79 | 0.55277 |
d59944c310fa2ec459b91a3d3b59a19706725733 | 12,104 | py | Python | src/robots/poses/position.py | severin-lemaignan/pyrobots | d5dd3bd54375e85802de7225556ad519b8b4e89d | [
"0BSD"
] | 11 | 2017-03-06T17:19:59.000Z | 2021-11-04T07:45:33.000Z | src/robots/poses/position.py | severin-lemaignan/pyrobots | d5dd3bd54375e85802de7225556ad519b8b4e89d | [
"0BSD"
] | 2 | 2018-08-18T12:43:47.000Z | 2019-04-23T13:03:26.000Z | src/robots/poses/position.py | severin-lemaignan/pyrobots | d5dd3bd54375e85802de7225556ad519b8b4e89d | [
"0BSD"
] | 3 | 2018-04-24T10:25:53.000Z | 2021-08-25T04:34:35.000Z | # coding=utf-8
import logging; logger = logging.getLogger("robots.position")
import math
import numpy
import transformations
class UnknownFrameError(RuntimeError):
pass
class InvalidFrameError(RuntimeError):
pass
class FrameProvider(object):
def get_transform(self, frame):
""" Returns the trans... | 33.904762 | 116 | 0.516276 |
d5996bd7b3409b708ad2e7a01f518f6d139dcfc0 | 1,698 | py | Python | src/Python3/ser/reader.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/ser/reader.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | src/Python3/ser/reader.py | umyuu/Sample | 66e8cd725b682db4c9bf93fb80786eea8cbad19d | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
import time
from io import BytesIO
from contextlib import closing
import argparse
import serial
import tornado.ioloop
class MySerial(object):
def __init__(self, port: str, baud_rate: int, lineterminator: str):
self._serial_port = serial.Serial(port, baud_rate)
self._line_ter... | 29.789474 | 83 | 0.646643 |
d59994e37ed6430a815dc8cc5fe42d46100651bd | 1,562 | py | Python | homeassistant/components/notify/command_line.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | homeassistant/components/notify/command_line.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | homeassistant/components/notify/command_line.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """
Support for command line notification services.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.command_line/
"""
import logging
import subprocess
import voluptuous as vol
from homeassistant.const import (CONF_COMMAND, CONF_NAME)
from homeass... | 31.877551 | 75 | 0.705506 |
d599bb23224bea5476892a24033651f75436cc9a | 1,894 | py | Python | test.py | jimiolaniyan/tracksuite | f05c40e7b78ce2bb623a4ae76c08997a41585152 | [
"MIT"
] | null | null | null | test.py | jimiolaniyan/tracksuite | f05c40e7b78ce2bb623a4ae76c08997a41585152 | [
"MIT"
] | 1 | 2020-09-02T07:53:51.000Z | 2020-09-02T07:53:51.000Z | test.py | jimiolaniyan/tracksuite | f05c40e7b78ce2bb623a4ae76c08997a41585152 | [
"MIT"
] | null | null | null | import os
import numpy as np
import imageio
import cv2
import matplotlib.pyplot as plt
import torch
from torchvision import transforms
from tracksuite.trackers.goturn import Goturn
from tracksuite.utils.image import crop_and_scale, net_bb_to_orig_bb
def get_init_bb(gt):
# OTB gt is [left, top, width, height]
... | 27.057143 | 83 | 0.623548 |
d599d7aec733a6cbe83d5051bd9f54e84daf48ab | 2,560 | py | Python | Lib/site-packages/wx-3.0-msw/wx/lib/mixins/imagelist.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/mixins/imagelist.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/mixins/imagelist.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #----------------------------------------------------------------------------
# Name: wx.lib.mixins.imagelist
# Purpose: Helpful mix-in classes for using a wxImageList
#
# Author: Robin Dunn
#
# Created: 15-May-2001
# RCS-ID: $Id$
# Copyright: (c) 2001 by Total Control Software
# Licence: ... | 32.405063 | 81 | 0.526563 |
d599dd0dd29c80d90303b7fd6360c79cf7dec32e | 29,552 | py | Python | onadata/apps/viewer/tests/test_pandas_mongo_bridge.py | amks1/kobocat | 0f36c75cc55345716558e8bece2ef48567896997 | [
"BSD-2-Clause"
] | 87 | 2015-02-10T23:36:28.000Z | 2022-01-31T00:51:10.000Z | onadata/apps/viewer/tests/test_pandas_mongo_bridge.py | amks1/kobocat | 0f36c75cc55345716558e8bece2ef48567896997 | [
"BSD-2-Clause"
] | 443 | 2015-04-28T18:50:25.000Z | 2022-03-31T03:29:43.000Z | onadata/apps/viewer/tests/test_pandas_mongo_bridge.py | amks1/kobocat | 0f36c75cc55345716558e8bece2ef48567896997 | [
"BSD-2-Clause"
] | 122 | 2015-01-13T16:27:44.000Z | 2022-01-24T09:35:56.000Z | # coding: utf-8
import csv
import os
from tempfile import NamedTemporaryFile
from django.utils.dateparse import parse_datetime
from django.urls import reverse
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.logger.models.xform import XForm
from onadata.apps.logger.xform_instance_parser import... | 40.537723 | 80 | 0.575189 |
d599ecc171f0085180a5c968c66103591eb59027 | 2,503 | py | Python | setup.py | dgorelik/google-auth-library-python | bc92abbce5e0a5e7b5de8157e7772db84349a6cb | [
"Apache-2.0"
] | null | null | null | setup.py | dgorelik/google-auth-library-python | bc92abbce5e0a5e7b5de8157e7772db84349a6cb | [
"Apache-2.0"
] | null | null | null | setup.py | dgorelik/google-auth-library-python | bc92abbce5e0a5e7b5de8157e7772db84349a6cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google 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,... | 34.763889 | 82 | 0.653216 |
d599f20dc7cddd5216409339ac203cd70648e0fc | 14 | py | Python | SCRAPE/Lib/site-packages/twisted/words/test/__init__.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 09f6abfc3bcf10ee28f486d83b450c89a07e066e | [
"MIT"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/words/test/__init__.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 1,243 | 2015-01-23T17:23:59.000Z | 2022-03-28T13:46:17.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/words/test/__init__.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | "Words tests"
| 7 | 13 | 0.714286 |
d59a0c70d823ca000c39824567eaea523fb1fc6a | 59 | py | Python | revrand/mathfun/__init__.py | basaks/revrand | 4c1881b6c1772d2b988518e49dde954f165acfb6 | [
"Apache-2.0"
] | 62 | 2015-11-06T00:45:21.000Z | 2022-03-21T08:08:29.000Z | revrand/mathfun/__init__.py | basaks/revrand | 4c1881b6c1772d2b988518e49dde954f165acfb6 | [
"Apache-2.0"
] | 112 | 2015-11-05T06:47:16.000Z | 2021-06-28T20:07:26.000Z | revrand/mathfun/__init__.py | basaks/revrand | 4c1881b6c1772d2b988518e49dde954f165acfb6 | [
"Apache-2.0"
] | 16 | 2016-04-10T08:54:07.000Z | 2021-04-27T11:43:53.000Z | """
Mathematical functions not included in numpy/scipy
"""
| 14.75 | 50 | 0.745763 |
d59a2c0d58bab90629895dade6f219683a78c508 | 998 | py | Python | chapter3/code/google_translate.py | PacktPublishing/Advanced-Web-Scraping-with-Python | 6624b71b2889a6fcfa3f080a6e15b979e582cce6 | [
"MIT"
] | 13 | 2019-11-01T09:31:42.000Z | 2021-12-19T17:19:07.000Z | chapter3/code/google_translate.py | PacktPublishing/Advanced-Web-Scraping-with-Python | 6624b71b2889a6fcfa3f080a6e15b979e582cce6 | [
"MIT"
] | null | null | null | chapter3/code/google_translate.py | PacktPublishing/Advanced-Web-Scraping-with-Python | 6624b71b2889a6fcfa3f080a6e15b979e582cce6 | [
"MIT"
] | 7 | 2019-11-08T17:27:28.000Z | 2021-09-09T09:19:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import sys
from selenium import webdriver
import time
#Example input to enter : en (= english)
convert_from = input("Language to Convert from : ")
#Example input to enter : es (= spanish)
convert_to = input("Language to Conve... | 27.722222 | 138 | 0.737475 |
d59a3f2a737ee35dbf1ebd5e4a3edc7db5848859 | 403 | py | Python | pandaharvester/harvesterstager/base_stager.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 11 | 2017-06-01T10:16:58.000Z | 2019-11-22T08:41:36.000Z | pandaharvester/harvesterstager/base_stager.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 34 | 2016-10-25T19:15:24.000Z | 2021-03-05T12:59:04.000Z | pandaharvester/harvesterstager/base_stager.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 17 | 2016-10-24T13:29:45.000Z | 2021-03-23T17:35:27.000Z | from pandaharvester.harvesterzipper.base_zipper import BaseZipper
# base class for stager plugin inheriting from BaseZipper since zip functions
# were moved from stager to zipper
class BaseStager(BaseZipper):
# constructor
def __init__(self, **kwarg):
self.zipDir = "${SRCDIR}"
self.zip_tmp_log... | 31 | 77 | 0.717122 |
d59a55ea9e99cd50d5cbb73b13dd092c11137796 | 1,905 | py | Python | app/fastapi/dependencies.py | PSE-TECO-2020-TEAM1/e2e-ml_model-management | 7f01a008648e25a29c639a5e16124b2e399eb821 | [
"MIT"
] | 1 | 2021-05-04T08:46:19.000Z | 2021-05-04T08:46:19.000Z | app/fastapi/dependencies.py | PSE-TECO-2020-TEAM1/e2e-ml_model-management | 7f01a008648e25a29c639a5e16124b2e399eb821 | [
"MIT"
] | null | null | null | app/fastapi/dependencies.py | PSE-TECO-2020-TEAM1/e2e-ml_model-management | 7f01a008648e25a29c639a5e16124b2e399eb821 | [
"MIT"
] | 1 | 2022-01-28T21:21:32.000Z | 2022-01-28T21:21:32.000Z | from app.models.domain.prediction_key import PredictionKey
from app.models.domain.ml_model import MlModel
from app.fastapi.services import get_ml_model, get_prediction_key, workspace_belongs_to_user
from app.models.schemas.mongo_model import OID
from fastapi.exceptions import HTTPException
from fastapi import Header
fr... | 41.413043 | 119 | 0.792126 |
d59a59c43507420d5046a4b3649413975fe4dd5d | 6,168 | py | Python | PriceCutdown/monitor.py | fioan89/Price-Cutdown | eca90719f8b7016011cd2c7cdcb3dec4701adbc5 | [
"MIT"
] | null | null | null | PriceCutdown/monitor.py | fioan89/Price-Cutdown | eca90719f8b7016011cd2c7cdcb3dec4701adbc5 | [
"MIT"
] | null | null | null | PriceCutdown/monitor.py | fioan89/Price-Cutdown | eca90719f8b7016011cd2c7cdcb3dec4701adbc5 | [
"MIT"
] | null | null | null | __author__ = 'fauri'
import psycopg2
import settings
from email_postman import GmailPostMan
SELECT_PROD_IDS_DISTINCT = "SELECT DISTINCT prod_id, name, url FROM products ORDER BY prod_id"
# Result
# [(1,'product long name', 'http://www.<provider>.com/product_location_xxssd_dsad')]
SELECT_PRICES = "SELECT price, date... | 45.021898 | 119 | 0.618839 |
d59a5a24a8c6f221317fdb3acdbfa53b0577a1a1 | 408 | py | Python | src/Parsers/data_parser.py | amitsou/Multimodal-User-Monitoring | 178049485b4afe5fbf9511e74e4c2f78bd89d426 | [
"MIT"
] | 2 | 2020-07-28T14:20:45.000Z | 2021-01-07T23:55:52.000Z | src/Parsers/data_parser.py | amitsou/Multimodal-User-Monitoring | 178049485b4afe5fbf9511e74e4c2f78bd89d426 | [
"MIT"
] | 7 | 2020-06-30T13:00:10.000Z | 2021-01-09T00:47:22.000Z | src/Parsers/data_parser.py | amitsou/Multimodal-User-Monitoring | 178049485b4afe5fbf9511e74e4c2f78bd89d426 | [
"MIT"
] | 1 | 2020-12-15T15:07:18.000Z | 2020-12-15T15:07:18.000Z | # -*- coding: utf-8 -*-
import shutil
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.realpath(__file__)), "../"))
from Functions import utils as ut
if __name__ == '__main__':
#convert raw to csv
ut.parse_raw_data('Chair')
ut.parse_raw_data('Mouse')
ut.parse_raw_data... | 22.666667 | 48 | 0.681373 |
d59a820290723d6120f227037cd95e972f181593 | 15,507 | py | Python | pcdet/models/dense_heads/anchor_head_fuse_context_fpn.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 8 | 2021-06-23T02:06:56.000Z | 2022-03-18T08:34:32.000Z | pcdet/models/dense_heads/anchor_head_fuse_context_fpn.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 2 | 2021-07-17T11:19:14.000Z | 2021-09-25T03:30:36.000Z | pcdet/models/dense_heads/anchor_head_fuse_context_fpn.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from .anchor_head_template import AnchorHeadTemplate
class GradReverse(torch.autograd.Function):
def __init__(self, lambd):
self.lambd = lambd
def forward(self, x):
return x.view_as(x)
def backward(self, grad_output):
return (g... | 45.608824 | 232 | 0.56194 |
d59aa3bbc9cb3abf814e2afb766005fe8af4d141 | 9,235 | py | Python | pypykatz/lsadecryptor/packages/credman/templates.py | retr0-13/pypykatz | 0d689fbd819c52ca46709737b2c063f40e302832 | [
"MIT"
] | 1 | 2018-08-19T11:53:30.000Z | 2018-08-19T11:53:30.000Z | pypykatz/lsadecryptor/packages/credman/templates.py | retr0-13/pypykatz | 0d689fbd819c52ca46709737b2c063f40e302832 | [
"MIT"
] | null | null | null | pypykatz/lsadecryptor/packages/credman/templates.py | retr0-13/pypykatz | 0d689fbd819c52ca46709737b2c063f40e302832 | [
"MIT"
] | 2 | 2019-08-04T23:16:05.000Z | 2019-12-05T10:41:50.000Z | #!/usr/bin/env python3
#
# Author:
# Tamas Jos (@skelsec)
#
import io
import logging
from minidump.win_datatypes import *
from pypykatz.commons.common import *
from pypykatz.commons.win_datatypes import *
from pypykatz.lsadecryptor.package_commons import *
class CredmanTemplate(PackageTemplate):
def __init__(self):
... | 32.29021 | 102 | 0.749973 |
d59ab10102a33b5ba98005d4d1c4b8d6bbf24435 | 659 | py | Python | flexget/tests/test_crossmatch.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/tests/test_crossmatch.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/tests/test_crossmatch.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
class TestCrossmatch(object):
config = """
tasks:
test_title:
mock:
- title: entry 1
- title: entry 2
cros... | 27.458333 | 74 | 0.553869 |
d59aba66542dd9cc2557c8d6ef1ff1ad42f722b4 | 1,334 | py | Python | hs_tools_resource/migrations/0018_auto_20180530_2246.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_tools_resource/migrations/0018_auto_20180530_2246.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_tools_resource/migrations/0018_auto_20180530_2246.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('hs_tools_resource', '0017_auto_20171128_1852'),
]
operations = [
migrations.CreateModel(
nam... | 37.055556 | 156 | 0.616942 |
d59ac6850076e4e251b375d1632fc32eab8726b2 | 1,945 | py | Python | exts/GuildConfig.py | mihirsh02/Zeta | 66830b296996a94df1e5b4ad42a2997fc6beeb79 | [
"MIT"
] | null | null | null | exts/GuildConfig.py | mihirsh02/Zeta | 66830b296996a94df1e5b4ad42a2997fc6beeb79 | [
"MIT"
] | null | null | null | exts/GuildConfig.py | mihirsh02/Zeta | 66830b296996a94df1e5b4ad42a2997fc6beeb79 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
class ConfigCommands(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@commands.has_guild_permissions(administrator=True)
async def prefix(self, ctx: commands.Context, prefix: str) -> None:
if len(... | 41.382979 | 113 | 0.541388 |
d59acb2e5b0086654d3d6cdc2f5de2d4eba46754 | 1,020,557 | py | Python | test/test_nn.py | iyuanyin/pytorch | e21c0ac9a5d318a62371a6348c7fecc5e905129c | [
"Intel"
] | null | null | null | test/test_nn.py | iyuanyin/pytorch | e21c0ac9a5d318a62371a6348c7fecc5e905129c | [
"Intel"
] | null | null | null | test/test_nn.py | iyuanyin/pytorch | e21c0ac9a5d318a62371a6348c7fecc5e905129c | [
"Intel"
] | null | null | null | # Owner(s): ["module: nn"]
import contextlib
import math
import random
import string
import unittest
import io
import unittest.mock as mock
import itertools
import warnings
import pickle
from copy import deepcopy
from itertools import repeat, product
from functools import reduce, partial
from operator import mul
from ... | 46.598648 | 132 | 0.585961 |
d59aecbc060f526d4bb4afe1fc013e64fc8cb564 | 1,102 | py | Python | homeassistant/components/switch_as_x/config_flow.py | Junker/core | cd3f931dedf9981303fd41c8016164cb27efd89b | [
"Apache-2.0"
] | null | null | null | homeassistant/components/switch_as_x/config_flow.py | Junker/core | cd3f931dedf9981303fd41c8016164cb27efd89b | [
"Apache-2.0"
] | 13 | 2021-12-16T20:49:04.000Z | 2022-03-31T06:26:43.000Z | homeassistant/components/switch_as_x/config_flow.py | Junker/core | cd3f931dedf9981303fd41c8016164cb27efd89b | [
"Apache-2.0"
] | null | null | null | """Config flow for Switch as X integration."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
import voluptuous as vol
from homeassistant.helpers import helper_config_entry_flow, selector
from . import DOMAIN
CONFIG_FLOW = {
"user": helper_config_entry_flow.Helper... | 26.878049 | 74 | 0.627042 |
d59afe6f626771bb9d3511686dd892be4e50479e | 555 | py | Python | setup.py | deniz195/jataruku | 13a1bc584feb3b6e419bf95233c332efa04ed63d | [
"BSD-2-Clause"
] | 1 | 2018-10-02T18:47:31.000Z | 2018-10-02T18:47:31.000Z | setup.py | deniz195/jataruku | 13a1bc584feb3b6e419bf95233c332efa04ed63d | [
"BSD-2-Clause"
] | null | null | null | setup.py | deniz195/jataruku | 13a1bc584feb3b6e419bf95233c332efa04ed63d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Learn more: https://github.com/kennethreitz/setup.py
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='jataruku',
version='0.1.0',
description='A PID controller written... | 23.125 | 54 | 0.668468 |
d59b20306eff3f9625119c3a5548991937c6d6be | 9,846 | py | Python | Escape/Escape.py | xyntechx/Simple-Python-Projects | 1207f2956ced5244b0509598c68435d76eb03ddd | [
"MIT"
] | 3 | 2020-12-27T11:48:49.000Z | 2021-02-16T04:36:16.000Z | Escape/Escape.py | xyntechx/Simple-Python-Projects | 1207f2956ced5244b0509598c68435d76eb03ddd | [
"MIT"
] | null | null | null | Escape/Escape.py | xyntechx/Simple-Python-Projects | 1207f2956ced5244b0509598c68435d76eb03ddd | [
"MIT"
] | null | null | null | import random
import colorama
colorama.init()
class Color:
PURPLE = '\033[95m' #when using items
GREEN = '\033[92m' #when healed
YELLOW = '\033[93m' #when obtaining items
RED = '\033[91m' #when damaged
BOLD = '\033[1m' #THE VOICE
CYAN = '\033[96m' #The Game
END = '\033[0m'
c... | 40.352459 | 175 | 0.564493 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.