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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73e669cb3bac808cd6231439760e24915b76113d | 830 | py | Python | tests/basic_stages/test_schematize.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 269 | 2019-12-21T13:30:37.000Z | 2022-03-27T18:41:36.000Z | tests/basic_stages/test_schematize.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 68 | 2019-12-21T12:51:51.000Z | 2022-03-13T13:06:14.000Z | tests/basic_stages/test_schematize.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 30 | 2019-12-21T12:18:18.000Z | 2022-03-17T05:53:19.000Z | """Testing the ColReorder stage."""
import pytest
import pandas as pd
from pdpipe import Schematize
from pdpipe.exceptions import FailedPreconditionError
def _df():
return pd.DataFrame([[2, 4, 8], [3, 6, 9]], [1, 2], ['a', 'b', 'c'])
def test_schematize():
df = _df()
stage = Schematize(['a', 'c'])
... | 23.714286 | 72 | 0.571084 |
73e66f2200986a9c8e9ce37d9c22e9a32b812074 | 789 | py | Python | arjuna/engine/data/record.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/engine/data/record.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/engine/data/record.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 34.304348 | 74 | 0.757921 |
73e67842fde253a90d4c258da79532085b5d4b1a | 2,101 | py | Python | conduit/tests/test_parameterization.py | elenimath/saber | 71acab9798cf3aee1c4d64b09453e5234f8fdf1e | [
"Apache-2.0"
] | 12 | 2018-05-14T17:43:18.000Z | 2021-11-16T04:03:33.000Z | conduit/tests/test_parameterization.py | elenimath/saber | 71acab9798cf3aee1c4d64b09453e5234f8fdf1e | [
"Apache-2.0"
] | 34 | 2019-05-06T19:13:36.000Z | 2021-05-06T19:12:35.000Z | conduit/tests/test_parameterization.py | elenimath/saber | 71acab9798cf3aee1c4d64b09453e5234f8fdf1e | [
"Apache-2.0"
] | 3 | 2019-10-08T17:42:17.000Z | 2021-07-28T05:52:02.000Z |
import unittest
import yaml
import json
import os
import itertools
import numpy as np
from conduit.utils.parameterization import parameterize
from conduit.tests.testing_utils import load_test_data
class TestParameterization(unittest.TestCase):
def setUp(self):
self._test_data = load_test_data('test_paramet... | 30.014286 | 87 | 0.519752 |
73e6b51c58711541532e5955ad2c0be42fbbe9e7 | 3,343 | py | Python | melody/constraints/equal_pitch_constraint.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | 1 | 2021-05-06T19:45:54.000Z | 2021-05-06T19:45:54.000Z | melody/constraints/equal_pitch_constraint.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | null | null | null | melody/constraints/equal_pitch_constraint.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | null | null | null | """
File: equal_pitch_policy.py
Purpose: Defines a two note policy where the second note's pitch must equal first note's pitch.
"""
from melody.constraints.abstract_constraint import AbstractConstraint
from structure.note import Note
from tonalmodel.pitch_scale import PitchScale
class EqualPitchConstraint(Abstract... | 37.988636 | 113 | 0.64822 |
73e6cc6359764d42fe0a659613e617637178d799 | 5,560 | py | Python | city_scrapers/spiders/chi_library.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | city_scrapers/spiders/chi_library.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | city_scrapers/spiders/chi_library.py | noahkconley/city-scrapers | 37420ce3a9295c2aac68c0fb4a957ad41394a801 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
All spiders should yield data shaped according to the Open Civic Data
specification (http://docs.opencivicdata.org/en/latest/data/event.html).
"""
import re
import requests
import json
import datetime
from city_scrapers.spider import Spider
class Chi_librarySpider(Spider):
name = 'chi... | 34.968553 | 112 | 0.577518 |
73e6d49701842df30038213a510474181808b907 | 1,810 | py | Python | src/CompartmentalSystems/example_smooth_model_runs.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | src/CompartmentalSystems/example_smooth_model_runs.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | src/CompartmentalSystems/example_smooth_model_runs.py | goujou/CompartmentalSystems | 4724555c33f11395ddc32738e8dfed7349ee155f | [
"MIT"
] | null | null | null | import numpy as np
from sympy import symbols
from . import example_smooth_reservoir_models as ESRM
from .smooth_model_run import SmoothModelRun
def critics():
symbs = symbols("t k_01 k_10 k_0o k_1o")
t, k_01, k_10, k_0o, k_1o = symbs
srm = ESRM.critics(symbs)
pardict = {k_0o: 0.01, k_1o: 0.08, k_01: ... | 30.166667 | 73 | 0.603867 |
73e6fbc6cab087e31cba335b15c12100556ea575 | 69,705 | py | Python | pymatgen/ext/matproj.py | chunweizhu/pymatgen | acfe5899ee50add1e2a0dd6385ee4fba78122e0f | [
"MIT"
] | 921 | 2015-01-25T22:17:05.000Z | 2022-03-27T20:58:38.000Z | pymatgen/ext/matproj.py | chunweizhu/pymatgen | acfe5899ee50add1e2a0dd6385ee4fba78122e0f | [
"MIT"
] | 1,631 | 2015-01-05T21:05:04.000Z | 2022-03-31T18:40:17.000Z | pymatgen/ext/matproj.py | chunweizhu/pymatgen | acfe5899ee50add1e2a0dd6385ee4fba78122e0f | [
"MIT"
] | 851 | 2015-01-01T17:38:00.000Z | 2022-03-31T02:14:07.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to interface with the Materials Project REST
API v2 to enable the creation of data structures and pymatgen objects using
Materials Project data.
To make use of the Materials AP... | 40.954759 | 120 | 0.593659 |
73e70175f6717da73eee89411870e07cd2ce6039 | 792 | py | Python | Part2/hash_table.py | ParashRahman/Database-Project | 3a934d82289b58dcf83497b658970b2d336c1fba | [
"Apache-2.0"
] | null | null | null | Part2/hash_table.py | ParashRahman/Database-Project | 3a934d82289b58dcf83497b658970b2d336c1fba | [
"Apache-2.0"
] | null | null | null | Part2/hash_table.py | ParashRahman/Database-Project | 3a934d82289b58dcf83497b658970b2d336c1fba | [
"Apache-2.0"
] | null | null | null | import bsddb
from DB import DB
# HashTable (subclass of DB)
class HashTable(DB):
def __init__(self, db_address):
# Database="Hash_table.db"
# self.address=db.address #contains address to db file's location
self.db = bsddb.hashopen(db_address, 'c')
DB.__init__(self, self.db, d... | 24.75 | 73 | 0.564394 |
73e73809f88ac0ca5abf35d40d4f5139e3b0155e | 1,486 | py | Python | raiden/tests/unit/storage/test_serialization.py | ExchangeUnion/raiden | 2217bcb698fcfce3499dc1f41ad919ed82e8e45f | [
"MIT"
] | null | null | null | raiden/tests/unit/storage/test_serialization.py | ExchangeUnion/raiden | 2217bcb698fcfce3499dc1f41ad919ed82e8e45f | [
"MIT"
] | 12 | 2019-08-09T19:12:17.000Z | 2019-12-05T15:49:29.000Z | raiden/tests/unit/storage/test_serialization.py | ExchangeUnion/raiden | 2217bcb698fcfce3499dc1f41ad919ed82e8e45f | [
"MIT"
] | null | null | null | import pytest
from raiden.storage.serialization.fields import (
BytesField,
OptionalIntegerToStringField,
QueueIdentifierField,
)
from raiden.tests.utils import factories
from raiden.transfer.identifiers import QueueIdentifier
def assert_roundtrip(field, value):
serialized = field._serialize(value, N... | 29.137255 | 97 | 0.76245 |
73e7398c67ff139f2c9f71344e23bf8c64ce19bc | 4,424 | py | Python | SciPy2016/MTwork/inv3d_HPK1/run4/findDiam_inversion.py | simpeg/simpegExamples | 38b8064fb854d809f72b7f1ca8b8096bca696af1 | [
"MIT"
] | 1 | 2021-08-07T13:46:54.000Z | 2021-08-07T13:46:54.000Z | SciPy2016/MTwork/inv3d_HPK1/run4/findDiam_inversion.py | simpeg/simpegExamples | 38b8064fb854d809f72b7f1ca8b8096bca696af1 | [
"MIT"
] | 1 | 2016-07-27T22:20:36.000Z | 2016-07-27T22:20:36.000Z | SciPy2016/MTwork/inv3d_HPK1/run4/findDiam_inversion.py | simpeg/simpegExamples | 38b8064fb854d809f72b7f1ca8b8096bca696af1 | [
"MIT"
] | null | null | null | # Import modules
import numpy as np, sys, os, time, gzip, cPickle as pickle, scipy
sys.path.append('/tera_raid/gudni/gitCodes/simpeg')
sys.path.append('/tera_raid/gudni')
from pymatsolver import MumpsSolver
import SimPEG as simpeg
from SimPEG import NSEM
from numpy.lib import recfunctions as rFunc
# Function to get da... | 33.263158 | 108 | 0.711799 |
73e75ef8295e6d9a5a07f2246991a25d1fca8903 | 262 | py | Python | file_utils.py | andrewlavaia/ParticleSimulation | afa1eaa95b68c1baaa607d9b0ff0f39717ad8e8b | [
"MIT"
] | null | null | null | file_utils.py | andrewlavaia/ParticleSimulation | afa1eaa95b68c1baaa607d9b0ff0f39717ad8e8b | [
"MIT"
] | null | null | null | file_utils.py | andrewlavaia/ParticleSimulation | afa1eaa95b68c1baaa607d9b0ff0f39717ad8e8b | [
"MIT"
] | null | null | null | import yaml
def load_config(file_string):
with open(file_string) as f:
dataMap = yaml.safe_load(f)
return dataMap
def set_config(data):
with open('config.yml', 'w') as outfile:
yaml.safe_dump(data, outfile, default_flow_style=False) | 26.2 | 63 | 0.694656 |
73e7877030afcf43c322e9a3e8a43a7ac0251a0a | 30,890 | py | Python | appengine/findit/first_party/logdog/annotations_pb2.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | appengine/findit/first_party/logdog/annotations_pb2.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | appengine/findit/first_party/logdog/annotations_pb2.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: annotations.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message a... | 38.182942 | 2,922 | 0.728585 |
73e7ac15ee74fe3b8d7613812fef0f76a8218708 | 7,503 | py | Python | src/utils.py | a11to1n3/X-Detector | 8d89c55d2578e03d42cb0b587165d0f17dede1b7 | [
"BSD-3-Clause"
] | null | null | null | src/utils.py | a11to1n3/X-Detector | 8d89c55d2578e03d42cb0b587165d0f17dede1b7 | [
"BSD-3-Clause"
] | null | null | null | src/utils.py | a11to1n3/X-Detector | 8d89c55d2578e03d42cb0b587165d0f17dede1b7 | [
"BSD-3-Clause"
] | null | null | null | import os
import copy
import pandas as pd
import cv2 as cv
import numpy as np
import torch
from PIL import Image, ImageDraw
from torchvision import transforms, utils, models
from sklearn.cluster import DBSCAN
from matplotlib import cm
import matplotlib.pyplot as plt
# Erase classes except one class
def eraseWithROI(im... | 46.602484 | 197 | 0.610422 |
73e7d15f45545c5c8759ccddfaba33e651999b42 | 12,237 | py | Python | tempest/api/compute/servers/test_create_server.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_create_server.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_create_server.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... | 43.860215 | 79 | 0.616981 |
73e7fe0630f465871f86d3c1d30ea72e6c52ae84 | 2,147 | py | Python | gtld_data/tools/create_data_from_zonefile.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | gtld_data/tools/create_data_from_zonefile.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | gtld_data/tools/create_data_from_zonefile.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | #!/usr/bin/env pyhton3
# Copyright 2018 Michael Casadevall <michael@casadevall.pro>
#
# 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
# ... | 38.339286 | 92 | 0.758733 |
73e84b2acebc09dc07b07cbff66efb0b46922fed | 7,263 | py | Python | tests/test_schedule_wiki_storage.py | slow-start-fans/slow-start-rewatch | 7cf0fc9434084b3b9fa23497b08b4c9e6c512250 | [
"MIT"
] | 1 | 2020-05-31T02:41:48.000Z | 2020-05-31T02:41:48.000Z | tests/test_schedule_wiki_storage.py | slow-start-fans/slow-start-rewatch | 7cf0fc9434084b3b9fa23497b08b4c9e6c512250 | [
"MIT"
] | 33 | 2020-05-27T01:17:42.000Z | 2021-03-01T16:09:33.000Z | tests/test_schedule_wiki_storage.py | slow-start-fans/slow-start-rewatch | 7cf0fc9434084b3b9fa23497b08b4c9e6c512250 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pathlib import Path
from unittest.mock import MagicMock, Mock, PropertyMock
import pytest
from praw.models.reddit.subreddit import SubredditWiki
from prawcore.exceptions import Forbidden, NotFound, PrawcoreException
from slow_start_rewatch.exceptions import (
InvalidWikiLink,
Mis... | 32.424107 | 76 | 0.739502 |
73e85b36ac2b88009da4bd434f55fbcf54f994ea | 2,355 | py | Python | tests/test_addons/test_addon_word_getter.py | cangirolave/loglan_db | 62508356e31624bc36c833cc12c3feaf64ff9767 | [
"MIT"
] | null | null | null | tests/test_addons/test_addon_word_getter.py | cangirolave/loglan_db | 62508356e31624bc36c833cc12c3feaf64ff9767 | [
"MIT"
] | 4 | 2021-10-01T09:38:13.000Z | 2021-10-22T04:20:58.000Z | tests/test_addons/test_addon_word_getter.py | cangirolave/loglan_db | 62508356e31624bc36c833cc12c3feaf64ff9767 | [
"MIT"
] | 3 | 2021-10-01T09:41:07.000Z | 2021-10-10T23:26:47.000Z | # -*- coding: utf-8 -*-
# pylint: disable=R0201, R0903, C0116, C0103
"""Base Model unit tests."""
import pytest
from loglan_db.model_db.base_definition import BaseDefinition as Definition
from loglan_db.model_db.base_event import BaseEvent as Event
from loglan_db.model_db.base_key import BaseKey as Key
from loglan_db... | 29.074074 | 75 | 0.655626 |
73e85fce131436144bb36fcb7143fcabf6fe48a9 | 491 | py | Python | test/filter1.py | sergey-serebryakov/mpipe | 5a1804cf64271931f0cd3e4fff3e2b38291212dd | [
"MIT"
] | null | null | null | test/filter1.py | sergey-serebryakov/mpipe | 5a1804cf64271931f0cd3e4fff3e2b38291212dd | [
"MIT"
] | null | null | null | test/filter1.py | sergey-serebryakov/mpipe | 5a1804cf64271931f0cd3e4fff3e2b38291212dd | [
"MIT"
] | null | null | null | import time
from mpipe import OrderedStage, FilterStage, Pipeline
def passthru(value):
time.sleep(0.013)
return value
s1 = FilterStage(
(OrderedStage(passthru),),
max_tasks=1,
)
p1 = Pipeline(s1)
def pull(task):
for task, result in p1.results():
if result:
print('{0} {1}'... | 15.83871 | 53 | 0.637475 |
73e86865a81a672e8e4a1c4d58e9b04b5edec774 | 489 | py | Python | mbrl/planning/__init__.py | MarkSelden/mbrl-lib | 26845b3a5d8930e00726cc56bf17707a7ac45083 | [
"MIT"
] | null | null | null | mbrl/planning/__init__.py | MarkSelden/mbrl-lib | 26845b3a5d8930e00726cc56bf17707a7ac45083 | [
"MIT"
] | null | null | null | mbrl/planning/__init__.py | MarkSelden/mbrl-lib | 26845b3a5d8930e00726cc56bf17707a7ac45083 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .core import Agent, RandomAgent, complete_agent_cfg, load_agent
from .trajectory_opt import (
CEMOptimizer,
I... | 27.166667 | 71 | 0.773006 |
73e8758dfbf2aa53baf368cecf31a4631046c220 | 892 | py | Python | PyXAB/algos/VPCT.py | WilliamLwj/PyXAB | a95c713090fe875bc557bc7b0e11ab000a921407 | [
"MIT"
] | null | null | null | PyXAB/algos/VPCT.py | WilliamLwj/PyXAB | a95c713090fe875bc557bc7b0e11ab000a921407 | [
"MIT"
] | null | null | null | PyXAB/algos/VPCT.py | WilliamLwj/PyXAB | a95c713090fe875bc557bc7b0e11ab000a921407 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implementation of VPCT (Li et al. 2021)
"""
# Author: Wenjie Li <li3549@purdue.edu>
# License: MIT
import numpy as np
from PyXAB.algos.Algo import Algorithm
from PyXAB.algos.VHCT import VHCT
from PyXAB.algos.GPO import GPO
class VPCT(Algorithm):
def __init__(self, numax=1, rhomax=0.9, ... | 29.733333 | 118 | 0.682735 |
73e89fc36e39029cfb0c0425ff4239b8400a8512 | 21,811 | py | Python | trainer_base_mul_apex.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 8 | 2022-03-01T09:02:44.000Z | 2022-03-18T14:41:56.000Z | trainer_base_mul_apex.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 1 | 2022-03-09T12:12:22.000Z | 2022-03-10T09:08:42.000Z | trainer_base_mul_apex.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 2 | 2022-03-02T01:46:52.000Z | 2022-03-02T13:51:53.000Z | # 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
# d... | 44.603272 | 137 | 0.641236 |
73e8aec8eec39a6fea22d6463ad11d269aa4d05f | 46 | py | Python | link/version.py | uhjish/link | b6a60b0c62547b5b6f3f1d6e89d0f5bfb798fbb9 | [
"Apache-2.0"
] | null | null | null | link/version.py | uhjish/link | b6a60b0c62547b5b6f3f1d6e89d0f5bfb798fbb9 | [
"Apache-2.0"
] | null | null | null | link/version.py | uhjish/link | b6a60b0c62547b5b6f3f1d6e89d0f5bfb798fbb9 | [
"Apache-2.0"
] | null | null | null | version = '0.1.1'
version_details = (0, 1, 1)
| 15.333333 | 27 | 0.608696 |
73e8be9cbee5420e2900177872da1fef4c557a7e | 3,243 | py | Python | tests/test_models/test_sngan_proj.py | liuhd073/mmgeneration | 2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_sngan_proj.py | liuhd073/mmgeneration | 2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d | [
"Apache-2.0"
] | null | null | null | tests/test_models/test_sngan_proj.py | liuhd073/mmgeneration | 2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmgen.models.gans import BasicConditionalGAN
class TestSNGAN_PROJ:
@classmethod
def setup_class(cls):
cls.generator_cfg = dict(
type='SNGANGenerator',
output_scale=32,
base_channels=25... | 35.25 | 78 | 0.625039 |
73e8d06cf883e1469a91da290401a15b0ac22074 | 17,480 | py | Python | appengine/gce-backend/proto/config_pb2.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | null | null | null | appengine/gce-backend/proto/config_pb2.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | null | null | null | appengine/gce-backend/proto/config_pb2.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | 1 | 2020-07-05T19:54:40.000Z | 2020-07-05T19:54:40.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflec... | 43.591022 | 1,478 | 0.76127 |
73e8ecfc1a391b62d1032891ac8e8a249635cf2f | 951 | py | Python | buildscripts/gdb_test_ci.py | calcmogul/Robot-2020 | b416c202794fb7deea0081beff2f986de7001ed9 | [
"BSD-3-Clause"
] | 10 | 2020-02-07T04:13:15.000Z | 2022-02-26T00:13:39.000Z | buildscripts/gdb_test_ci.py | calcmogul/Robot-2020 | b416c202794fb7deea0081beff2f986de7001ed9 | [
"BSD-3-Clause"
] | 82 | 2020-02-12T03:05:15.000Z | 2022-02-18T02:14:38.000Z | buildscripts/gdb_test_ci.py | calcmogul/Robot-2020 | b416c202794fb7deea0081beff2f986de7001ed9 | [
"BSD-3-Clause"
] | 5 | 2020-02-14T16:24:01.000Z | 2022-03-31T09:10:01.000Z | #!/usr/bin/env python3
import os
import platform
import subprocess
if platform.system() == "Linux":
task_os = "linux"
elif platform.system() == "Darwin":
task_os = "osx"
elif platform.system() == "Windows":
task_os = "windows"
# Build tests
subprocess.run([
"./gradlew installFrcUserProgramTest" + tas... | 26.416667 | 73 | 0.683491 |
73e9280839fc70cd960bf152f528ce7e653b2ed9 | 2,118 | py | Python | src/dataverk/connectors/jsonstat.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 3 | 2019-09-29T20:48:46.000Z | 2021-03-31T10:16:07.000Z | src/dataverk/connectors/jsonstat.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 148 | 2019-02-08T12:30:58.000Z | 2021-03-11T15:31:55.000Z | src/dataverk/connectors/jsonstat.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 1 | 2020-11-18T14:10:05.000Z | 2020-11-18T14:10:05.000Z | import requests
import json
from pyjstat import pyjstat
from collections import OrderedDict
import pandas as pd
import ast
from dataverk.abc.base import DataverkBase
class JSONStatConnector(DataverkBase):
"""JSONStat based connections
"""
def __init__(self):
super().__init__()
... | 29.830986 | 122 | 0.573654 |
73e95f711f5ba25afd68c795f8b60e9ded907844 | 37 | py | Python | tests/assets/dependenciespackage/dependenciespackage/two.py | SimonBiggs/layer_linter | 9eb518b74118e4a2d8079e2f32ecc12612ca9e86 | [
"BSD-3-Clause"
] | 63 | 2018-06-21T10:39:54.000Z | 2021-06-04T14:28:44.000Z | tests/assets/dependenciespackage/dependenciespackage/two.py | SimonBiggs/layer_linter | 9eb518b74118e4a2d8079e2f32ecc12612ca9e86 | [
"BSD-3-Clause"
] | 86 | 2018-06-20T13:30:30.000Z | 2019-06-04T12:47:28.000Z | tests/assets/dependenciespackage/dependenciespackage/two.py | SimonBiggs/layer_linter | 9eb518b74118e4a2d8079e2f32ecc12612ca9e86 | [
"BSD-3-Clause"
] | 4 | 2018-08-14T08:49:55.000Z | 2019-02-16T09:24:47.000Z | from . import one # Relative import
| 18.5 | 36 | 0.72973 |
73e97fb50ba18a0b480bcaaabf2ca5cc867742c1 | 352 | py | Python | python/django/basic/pages/tests.py | y2ghost/work | b7f5b02db9dc0df6157bc799ddb4a1ac9d574cf3 | [
"MIT"
] | null | null | null | python/django/basic/pages/tests.py | y2ghost/work | b7f5b02db9dc0df6157bc799ddb4a1ac9d574cf3 | [
"MIT"
] | null | null | null | python/django/basic/pages/tests.py | y2ghost/work | b7f5b02db9dc0df6157bc799ddb4a1ac9d574cf3 | [
"MIT"
] | null | null | null | from django.test import SimpleTestCase
class SimpleTests(SimpleTestCase):
def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_about_page_status_code(self):
response = self.client.get('/about/')
self.assertEq... | 29.333333 | 51 | 0.715909 |
73e98d2d17d64ab0a875d084db5be4081efffcc7 | 2,247 | py | Python | machinelearning/test/iteratortest.py | hayj/MachineLearning | 66a34b6776450f7d597acca05525120fb28c8deb | [
"MIT"
] | null | null | null | machinelearning/test/iteratortest.py | hayj/MachineLearning | 66a34b6776450f7d597acca05525120fb28c8deb | [
"MIT"
] | null | null | null | machinelearning/test/iteratortest.py | hayj/MachineLearning | 66a34b6776450f7d597acca05525120fb28c8deb | [
"MIT"
] | null | null | null | from systemtools.basics import *
from systemtools.logger import *
from systemtools.location import *
from datastructuretools.processing import *
from datatools.jsonutils import *
import random
from multiprocessing import cpu_count, Process, Pipe, Queue, JoinableQueue
import queue
from machinelearning.iterator import *
... | 29.181818 | 226 | 0.733867 |
73e99b5ecb770674fdee260defa32af93e9be770 | 571 | py | Python | Chapter28/15_1.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | 19 | 2018-06-28T15:48:47.000Z | 2022-01-08T12:40:52.000Z | Chapter28/15_1.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | null | null | null | Chapter28/15_1.py | PacktPublishing/GettingStartedwithPythonfortheInternetofThings- | a5a86ae38b3a4c625dfc1213d32a3f49e1e298c6 | [
"MIT"
] | 13 | 2018-06-30T10:33:52.000Z | 2021-12-29T11:31:31.000Z | import signal
import flicklib
import time
def message(value):
print value
@flicklib.move()
def move(x, y, z):
global xyztxt
xyztxt = '{:5.3f} {:5.3f} {:5.3f}'.format(x,y,z)
@flicklib.flick()
def flick(start,finish):
global flicktxt
flicktxt = 'FLICK-' + start[0].upper() + finish[0].upper()
message(fli... | 19.689655 | 61 | 0.621716 |
73e9ad342226b1f1d009c5030e3af16d31cabe63 | 48,915 | py | Python | rigify/legacy/rigs/biped/limb_common.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | 1 | 2018-06-18T09:46:10.000Z | 2018-06-18T09:46:10.000Z | rigify/legacy/rigs/biped/limb_common.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | null | null | null | rigify/legacy/rigs/biped/limb_common.py | 1-MillionParanoidTterabytes/blender-addons-master | acc8fc23a38e6e89099c3e5079bea31ce85da06a | [
"Unlicense"
] | null | null | null | #====================== BEGIN GPL LICENSE BLOCK ======================
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later vers... | 37.977484 | 168 | 0.576858 |
73e9b65a192ba7a3c2a24d8871625e4b243a974a | 4,930 | py | Python | qiskit/optimization/algorithms/multistart_optimizer.py | georgios-ts/qiskit-aqua | 76f6a88bfc5f718e389da9c0e673a86101a8f452 | [
"Apache-2.0"
] | 1 | 2020-08-01T21:07:54.000Z | 2020-08-01T21:07:54.000Z | qiskit/optimization/algorithms/multistart_optimizer.py | georgios-ts/qiskit-aqua | 76f6a88bfc5f718e389da9c0e673a86101a8f452 | [
"Apache-2.0"
] | null | null | null | qiskit/optimization/algorithms/multistart_optimizer.py | georgios-ts/qiskit-aqua | 76f6a88bfc5f718e389da9c0e673a86101a8f452 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 37.067669 | 98 | 0.631034 |
73e9f3ffb7c1366b16978ba26a76789aa736a7b3 | 47,692 | py | Python | floris/simulation/turbine.py | tangsmall/floris | 51e4e15c6a9b0c8f55bf01772111799803acf224 | [
"Apache-2.0"
] | null | null | null | floris/simulation/turbine.py | tangsmall/floris | 51e4e15c6a9b0c8f55bf01772111799803acf224 | [
"Apache-2.0"
] | null | null | null | floris/simulation/turbine.py | tangsmall/floris | 51e4e15c6a9b0c8f55bf01772111799803acf224 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 NREL
# 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
# distri... | 42.317657 | 237 | 0.573136 |
73e9f99ef9550a3c7afd415664878ca0ae55cf8c | 147,708 | py | Python | design_utils/design.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | 14 | 2021-06-01T16:45:19.000Z | 2022-03-08T20:07:00.000Z | design_utils/design.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | null | null | null | design_utils/design.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | 3 | 2021-08-05T16:37:47.000Z | 2022-01-06T00:25:49.000Z | #Copyright (c) Facebook, Inc. and its affiliates.
#This source code is licensed under the MIT license found in the
#LICENSE file in the root directory of this source tree.
import _pickle as cPickle
from design_utils.components.hardware import *
from design_utils.components.workload import *
from design_utils.components... | 51.700385 | 240 | 0.657114 |
73ea184bd7e584949bf21cf38f1acc7c8a33420e | 1,073 | py | Python | habitat/datasets/registration.py | Ram81/habitat-imitation-baselines | c6e11c8ebadbf1260e1bed58a5b8dfb7faf6a505 | [
"MIT"
] | null | null | null | habitat/datasets/registration.py | Ram81/habitat-imitation-baselines | c6e11c8ebadbf1260e1bed58a5b8dfb7faf6a505 | [
"MIT"
] | null | null | null | habitat/datasets/registration.py | Ram81/habitat-imitation-baselines | c6e11c8ebadbf1260e1bed58a5b8dfb7faf6a505 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from habitat.core.logging import logger
from habitat.core.registry import registry
from habitat.datasets.eqa import _try... | 37 | 79 | 0.825722 |
73ea7f5545f778bbefba83755e34695bd03c4bcf | 1,047 | py | Python | oscar/lib/python2.7/site-packages/django/conf/locale/es/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/es/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/es/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FO... | 30.794118 | 78 | 0.617956 |
73eac4a64b972c95b90219e7fe27b15c3929ed92 | 2,525 | py | Python | torchdata/datapipes/iter/util/hashchecker.py | Nayef211/data | 66b7ac07f75c45f1cc6aed71423fdb5d29a9648f | [
"BSD-3-Clause"
] | null | null | null | torchdata/datapipes/iter/util/hashchecker.py | Nayef211/data | 66b7ac07f75c45f1cc6aed71423fdb5d29a9648f | [
"BSD-3-Clause"
] | null | null | null | torchdata/datapipes/iter/util/hashchecker.py | Nayef211/data | 66b7ac07f75c45f1cc6aed71423fdb5d29a9648f | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import hashlib
from torch.utils.data import IterDataPipe, functional_datapipe
@functional_datapipe("check_hash")
class HashCheckerIterDataPipe(IterDataPipe):
r"""
Iterable DataPipe that computes and checks the hash of each file, from an input
DataPipe of... | 38.257576 | 110 | 0.623762 |
73ead015bc1fd3d5738e3e0737aae5b68a27e1e5 | 2,228 | py | Python | services/web/server/tests/integration/fixtures/docker_registry.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | services/web/server/tests/integration/fixtures/docker_registry.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | services/web/server/tests/integration/fixtures/docker_registry.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | # pylint:disable=wildcard-import
# pylint:disable=unused-import
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import docker
import pytest
import tenacity
@pytest.fixture(scope="session")
def docker_registry():
# run the registry outside of the ... | 36.52459 | 129 | 0.710503 |
73eadc293ab984e3be57de562cacb75d0b432974 | 343 | py | Python | tklife/skel/common_widgets.py | Aesonus/TkLife | 8e8f585be7f522134b9a5746b22185c2394d3d8d | [
"MIT"
] | null | null | null | tklife/skel/common_widgets.py | Aesonus/TkLife | 8e8f585be7f522134b9a5746b22185c2394d3d8d | [
"MIT"
] | 4 | 2021-05-02T17:33:19.000Z | 2021-05-16T18:53:51.000Z | tklife/skel/common_widgets.py | Aesonus/TkLife | 8e8f585be7f522134b9a5746b22185c2394d3d8d | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import ttk
from . import Skeleton
__all__ = ['SkelMain', 'SkelFrame', 'SkelLabelFrame', 'SkelToplevel']
class SkelMain(Skeleton, tk.Tk):
pass
class SkelFrame(Skeleton, ttk.Frame):
pass
class SkelLabelFrame(Skeleton, ttk.Labelframe):
pass
class SkelToplevel(Skeleton, t... | 17.15 | 69 | 0.731778 |
73eaf39693ffbcbd2a663d07c85eeca2b4806492 | 72,741 | py | Python | Internet-Worm/venv_macos/lib/python3.8/site-packages/fontTools/feaLib/builder.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | 2 | 2021-04-07T16:47:04.000Z | 2022-01-15T04:01:01.000Z | app/src/main/python/fontTools/feaLib/builder.py | KhunHtetzNaing/ColorFontTool | c447d5377c6c53e85731d65248ebb781f786276b | [
"MIT"
] | null | null | null | app/src/main/python/fontTools/feaLib/builder.py | KhunHtetzNaing/ColorFontTool | c447d5377c6c53e85731d65248ebb781f786276b | [
"MIT"
] | null | null | null | from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import binary2num, safeEval
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.parser import Parser
from fontTools.feaLib.ast import FeatureFile
from fontTools.otlLib import builder as otl
from fontT... | 41.974033 | 83 | 0.597517 |
73eb4e26e5da71474e4b9d58474e2d22b89e338c | 754 | py | Python | appengine/findit/model/test/entity_util_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/model/test/entity_util_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/model/test/entity_util_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2018 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.
from google.appengine.ext import ndb
from gae_libs.testcase import TestCase
from model import entity_util
class TestModel(ndb.Model):
"""Ndb model to as... | 29 | 75 | 0.762599 |
73eb5246426fa6ef12cfa493b18fbae112df49e2 | 2,863 | py | Python | pytorch_src/cnn_context_classifier.py | seraphinatarrant/plan-write-revise-demo | b394657b1bd1d6978ea31d6ac5bad6f3a4b6e1da | [
"MIT"
] | 30 | 2019-04-14T03:30:10.000Z | 2021-06-23T18:49:54.000Z | pytorch_src/cnn_context_classifier.py | seraphinatarrant/plan-write-revise-demo | b394657b1bd1d6978ea31d6ac5bad6f3a4b6e1da | [
"MIT"
] | 2 | 2019-08-20T19:00:53.000Z | 2022-03-04T12:16:06.000Z | pytorch_src/cnn_context_classifier.py | seraphinatarrant/plan-write-revise-demo | b394657b1bd1d6978ea31d6ac5bad6f3a4b6e1da | [
"MIT"
] | 5 | 2019-06-26T10:29:01.000Z | 2020-09-16T06:03:13.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
class CNNContextClassifier(nn.Module):
def __init__(self, vocab_size, embedding_dim, hidden_dim,
filter_size, dropout_rate, embed_mat=None, fix_embeddings=False):
super(CNNContextClassifi... | 38.689189 | 99 | 0.654907 |
73eb5d9f60b3e2efb39a861f0850c7a4cbdfd3b9 | 273 | py | Python | countdown.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | countdown.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | countdown.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | def countdown_for(start=10):
for i in reversed(range(1, start + 1)):
print(i)
print('time is up')
def countdown_recursive(start=10):
if start > 0:
print(start)
countdown_recursive(start-1)
else:
print('time is up')
pass | 21 | 43 | 0.589744 |
73eb66bcf44da862411b6f08b72de56709543835 | 888 | py | Python | Leetcode/Majority Element I/boyer-moore-majority-vote-1.py | vedant-jad99/GeeksForGeeks-DSA-Workshop-Complete-Codes | 35cee8317c05b36864a992789c741554205b3919 | [
"MIT"
] | 1 | 2021-02-11T14:54:34.000Z | 2021-02-11T14:54:34.000Z | Leetcode/Majority Element I/boyer-moore-majority-vote-1.py | vedant-jad99/GeeksForGeeks-DSA-Workshop-Complete-Codes | 35cee8317c05b36864a992789c741554205b3919 | [
"MIT"
] | null | null | null | Leetcode/Majority Element I/boyer-moore-majority-vote-1.py | vedant-jad99/GeeksForGeeks-DSA-Workshop-Complete-Codes | 35cee8317c05b36864a992789c741554205b3919 | [
"MIT"
] | null | null | null | '''
Given an array nums of size n, return the majority element.
The majority element is the element that appears more than ⌊n / 2⌋ times.You may assume that the majority element always exists in the array.
Example:
Input - [2,2,1,1,1,2,2]
Output - 2
Explanation - 2 occurs more than 3 times
... | 24 | 141 | 0.513514 |
73ec05a726706dd9c0c3e74d677862b0366cb38b | 997 | py | Python | aamm/__init__.py | rshipp/appassure-mount-manager | 8caace9e023f2d8f2ceaa48153410ece07958fd8 | [
"BSD-3-Clause"
] | null | null | null | aamm/__init__.py | rshipp/appassure-mount-manager | 8caace9e023f2d8f2ceaa48153410ece07958fd8 | [
"BSD-3-Clause"
] | null | null | null | aamm/__init__.py | rshipp/appassure-mount-manager | 8caace9e023f2d8f2ceaa48153410ece07958fd8 | [
"BSD-3-Clause"
] | null | null | null | from pyramid.config import Configurator
from pyramid.renderers import JSON
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_chameleon')
config.add_renderer('prettyjson', JSON(indent=4))
... | 39.88 | 73 | 0.687061 |
73ec3c2688f32ea255f81d80547bee80fdfb91a2 | 2,985 | py | Python | loaner/web_app/backend/models/bigquery_row_model_test.py | riking/loaner | c131ee3ed543c018a0e039ae437fb8e83a912177 | [
"Apache-2.0"
] | null | null | null | loaner/web_app/backend/models/bigquery_row_model_test.py | riking/loaner | c131ee3ed543c018a0e039ae437fb8e83a912177 | [
"Apache-2.0"
] | null | null | null | loaner/web_app/backend/models/bigquery_row_model_test.py | riking/loaner | c131ee3ed543c018a0e039ae437fb8e83a912177 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.920455 | 78 | 0.733333 |
73eca54320938bf572f6faa6555e7aee7bb7a770 | 5,201 | py | Python | server/ldapauth.py | scieloorg/graph-data-experiment | fc108de204dfdfb48a9b32eff79476311eeb2c19 | [
"BSD-2-Clause"
] | 1 | 2019-04-18T18:48:25.000Z | 2019-04-18T18:48:25.000Z | server/ldapauth.py | scieloorg/graph-data-experiment | fc108de204dfdfb48a9b32eff79476311eeb2c19 | [
"BSD-2-Clause"
] | 6 | 2021-05-10T16:10:56.000Z | 2022-02-26T18:18:18.000Z | server/ldapauth.py | scieloorg/graph-data-experiment | fc108de204dfdfb48a9b32eff79476311eeb2c19 | [
"BSD-2-Clause"
] | null | null | null | from contextlib import asynccontextmanager
import re
from urllib.parse import parse_qs, unquote, urlparse
import bonsai
LDAP_DEFAULT_USER_FIELD = "sAMAccountName"
LDAP_DEFAULT_SEARCH_TEMPLATE = "(&(objectClass=person)({user_field}={0}))"
# Avoid bug described in https://github.com/noirello/bonsai/issues/25
bonsai.... | 37.15 | 74 | 0.6393 |
73ecd779bfd969453218564c26e0f2e52d929575 | 2,860 | py | Python | cassandra_nodetool/tests/conftest.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2020-08-08T02:01:01.000Z | 2020-08-08T02:01:01.000Z | cassandra_nodetool/tests/conftest.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2018-08-15T05:50:17.000Z | 2018-08-15T05:50:17.000Z | cassandra_nodetool/tests/conftest.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2019-03-06T14:30:52.000Z | 2019-03-06T14:30:52.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import subprocess
import stat
import os
import logging
import pytest
import time
import common
log = logging.getLogger(__file__)
def wait_on_docker_logs(container_name, max_wait, sentences):
args = [
... | 28.888889 | 105 | 0.664685 |
73ecf600501d86d925a898524b8864a671472d55 | 1,056 | py | Python | utils.py | FinchZHU/ultra-thin-PRM | 1cdfd1c521f4420164ea55ff8f940fa6d29eb7ac | [
"MIT"
] | 58 | 2019-07-26T17:40:25.000Z | 2021-08-13T02:59:23.000Z | utils.py | FinchZHU/ultra-thin-PRM | 1cdfd1c521f4420164ea55ff8f940fa6d29eb7ac | [
"MIT"
] | 11 | 2019-07-29T16:10:02.000Z | 2021-06-05T13:52:50.000Z | utils.py | FinchZHU/ultra-thin-PRM | 1cdfd1c521f4420164ea55ff8f940fa6d29eb7ac | [
"MIT"
] | 19 | 2019-07-26T17:39:57.000Z | 2021-08-16T07:36:21.000Z | import base64
# from typing import Tuple, List, Union, Dict, Iterable
import numpy as np
# import torch.nn as nn
def rle_encode(mask: np.ndarray) -> dict:
"""Perform Run-Length Encoding (RLE) on a binary mask.
"""
assert mask.dtype == bool and mask.ndim == 2, 'RLE encoding requires a binary mask (dtype=b... | 33 | 106 | 0.624053 |
73ed04b840b231e10b628a0d184724b873f5d43f | 851 | py | Python | client/verta/verta/_swagger/_public/modeldb/model/ModeldbUpdateExperimentNameOrDescription.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbUpdateExperimentNameOrDescription.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbUpdateExperimentNameOrDescription.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class ModeldbUpdateExperimentNameOrDescription(BaseType):
def __init__(self, id=None, name=None, description=None):
required = {
"id": False,
"name": False,
"description": False,
}
self.id = id
... | 23.638889 | 62 | 0.618096 |
73ed1c00261ef469147298dfc8130b56df8ae2c4 | 1,090 | py | Python | experiment_process.py | naummo/swarm_maze_opencl_solver | 1047e1293e90f484ccc4ff77cfe61196fb7cbbc6 | [
"MIT"
] | null | null | null | experiment_process.py | naummo/swarm_maze_opencl_solver | 1047e1293e90f484ccc4ff77cfe61196fb7cbbc6 | [
"MIT"
] | null | null | null | experiment_process.py | naummo/swarm_maze_opencl_solver | 1047e1293e90f484ccc4ff77cfe61196fb7cbbc6 | [
"MIT"
] | null | null | null | """
experiment_process.py contains some post-processing functionality.
Not used anymore.
"""
import csv
import os
import numpy as np
import configs as cfg
if not os.path.exists(cfg.reporting_dir):
os.makedirs(cfg.reporting_dir)
# Collisions
results = [0 for i in range(cfg.seconds)]
for filename in os.listdir(cf... | 32.058824 | 83 | 0.641284 |
73ed4f710a7fb8c83b94a5edd8eddbe280fd00ea | 2,703 | py | Python | src/onecontainer_cloud_tool/utils.py | intel/oneContainer-Cloud-Tool | 843fd4f6aa2e168ac7a7b544e05b92a7495e1121 | [
"BSD-3-Clause"
] | null | null | null | src/onecontainer_cloud_tool/utils.py | intel/oneContainer-Cloud-Tool | 843fd4f6aa2e168ac7a7b544e05b92a7495e1121 | [
"BSD-3-Clause"
] | null | null | null | src/onecontainer_cloud_tool/utils.py | intel/oneContainer-Cloud-Tool | 843fd4f6aa2e168ac7a7b544e05b92a7495e1121 | [
"BSD-3-Clause"
] | 3 | 2021-01-04T10:29:16.000Z | 2022-02-19T00:07:15.000Z | """common utilities."""
import datetime
import math
from pathlib import Path
import uuid
import os
import sys
from Cryptodome.PublicKey import RSA
from onecontainer_cloud_tool.logger import logger
def timestamp():
"""timestamp."""
return math.floor(datetime.datetime.now().timestamp())
def uuid_str():
... | 28.452632 | 92 | 0.610803 |
73ed7a4f9ecbe2874d723c546ddf57c5209ce152 | 9,726 | py | Python | benchmark/validate_on_lfw.py | jw-pyo/coral_utils | 715b38aacf9563fd45366f46f04f27658680852e | [
"MIT"
] | 2 | 2020-01-24T16:51:40.000Z | 2020-01-24T16:51:57.000Z | benchmark/validate_on_lfw.py | jw-pyo/coral_utils | 715b38aacf9563fd45366f46f04f27658680852e | [
"MIT"
] | null | null | null | benchmark/validate_on_lfw.py | jw-pyo/coral_utils | 715b38aacf9563fd45366f46f04f27658680852e | [
"MIT"
] | null | null | null | """Validate a face recognizer on the "Labeled Faces in the Wild" dataset (http://vis-www.cs.umass.edu/lfw/).
Embeddings are calculated using the pairs from http://vis-www.cs.umass.edu/lfw/pairs.txt and the ROC curve
is calculated and plotted. Both the model metagraph and the model parameters need to exist
in the same d... | 45.027778 | 193 | 0.687847 |
73ed96950f8b5821bfbbbb2adfda92d15f20964f | 8,600 | py | Python | lib/models/pose_mobilenetv2.py | CHUNYUWANG/imu-human-pose-pytorch | f4813336571789f46eabdfb520e7ed5b20ac04ea | [
"MIT"
] | 72 | 2020-03-26T13:26:39.000Z | 2022-03-16T08:45:34.000Z | lib/models/pose_mobilenetv2.py | zhezh/imu-human-pose-pytorch | f4813336571789f46eabdfb520e7ed5b20ac04ea | [
"MIT"
] | 10 | 2020-04-05T07:17:49.000Z | 2022-03-04T05:32:12.000Z | lib/models/pose_mobilenetv2.py | CHUNYUWANG/imu-human-pose-pytorch | f4813336571789f46eabdfb520e7ed5b20ac04ea | [
"MIT"
] | 13 | 2020-04-12T20:33:38.000Z | 2022-02-17T11:23:13.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import logging
import torch
import torch.nn as nn
import math
BN_MOMENTUM = 0.1
logger = logging.getLogger(__name__)
def c... | 34.95935 | 78 | 0.535116 |
73ede7b8b5373995fa8018c5efa802caa27e7384 | 87,582 | py | Python | tfoptflow/model_pwcnet.py | mf-zhang/tfoptflow | d27b249fcbae2d1f4373ef4ba16cb0c89890058e | [
"MIT"
] | null | null | null | tfoptflow/model_pwcnet.py | mf-zhang/tfoptflow | d27b249fcbae2d1f4373ef4ba16cb0c89890058e | [
"MIT"
] | null | null | null | tfoptflow/model_pwcnet.py | mf-zhang/tfoptflow | d27b249fcbae2d1f4373ef4ba16cb0c89890058e | [
"MIT"
] | null | null | null | """
model_pwcnet.py
PWC-Net model class.
Written by Phil Ferriere
Licensed under the MIT License (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function
import time
import datetime
import warnings
import numpy as np
import pandas as pd
import tensorflow as tf
from tqdm import ... | 54.096356 | 162 | 0.593638 |
73ee18b3fa5432773dd7b9ae20f4030af799d424 | 140 | py | Python | src/typeDefs/bay.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | null | null | null | src/typeDefs/bay.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | 21 | 2021-01-08T18:03:32.000Z | 2021-02-02T16:17:34.000Z | src/typeDefs/bay.py | nagasudhirpulla/wrldc_codebook | 8fbc795074e16e2012b29ae875b99aa721a7f021 | [
"MIT"
] | null | null | null | from src.typeDefs.element import IElement
class IBay(IElement):
bayNumber: str
stationName: str
bayType: str
voltage: str
| 15.555556 | 41 | 0.707143 |
73ee26638f821fa91e901fa44be61af5dd314396 | 4,649 | py | Python | tests/python/pants_test/backend/jvm/tasks/test_jvm_platform_analysis_integration.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_jvm_platform_analysis_integration.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_jvm_platform_analysis_integration.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from contextlib import contextmanager
from textwrap import dedent
from pants.u... | 35.48855 | 99 | 0.697139 |
73ee2ef8531de75a1cad0058cfade27b3af3e718 | 96,293 | py | Python | qiskit/circuit/quantumcircuit.py | nkanazawa1989/qiskit-terra | 88267be7228e5d09533e4e2d8bbccfcafa6f2e8c | [
"Apache-2.0"
] | 1 | 2019-06-04T12:23:36.000Z | 2019-06-04T12:23:36.000Z | qiskit/circuit/quantumcircuit.py | nkanazawa1989/qiskit-terra | 88267be7228e5d09533e4e2d8bbccfcafa6f2e8c | [
"Apache-2.0"
] | 35 | 2019-03-07T02:09:22.000Z | 2022-03-22T19:55:15.000Z | qiskit/circuit/quantumcircuit.py | nkanazawa1989/qiskit-terra | 88267be7228e5d09533e4e2d8bbccfcafa6f2e8c | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 41.976024 | 100 | 0.576137 |
73ee4de435b31e64815b354dadc3125e210e48fe | 9,793 | py | Python | astronomaly/feature_extraction/autoencoder.py | nmcardoso/astronomaly | 28c6a7ced2e1553de463a74fc3a19635e45ae548 | [
"BSD-3-Clause"
] | 48 | 2019-11-22T14:41:59.000Z | 2022-03-23T01:48:59.000Z | astronomaly/feature_extraction/autoencoder.py | nmcardoso/astronomaly | 28c6a7ced2e1553de463a74fc3a19635e45ae548 | [
"BSD-3-Clause"
] | 12 | 2021-02-23T15:35:29.000Z | 2022-01-26T09:48:35.000Z | astronomaly/feature_extraction/autoencoder.py | nmcardoso/astronomaly | 28c6a7ced2e1553de463a74fc3a19635e45ae548 | [
"BSD-3-Clause"
] | 6 | 2019-11-27T10:02:43.000Z | 2021-10-11T02:18:06.000Z | import numpy as np
import os
from astronomaly.base.base_pipeline import PipelineStage
try:
from keras.models import load_model
from keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D
from keras.models import Model
except ImportError:
print("Failed to import Keras. Deep learning will be unava... | 36.541045 | 79 | 0.572245 |
73ee601cee3e0a29da1ea2ce0685781d1a8cbdb9 | 19,078 | py | Python | lib/python3.8/site-packages/django_elasticsearch_dsl_drf/tests/test_filtering_common.py | ervinpepic/Kodecta_media_catalog | c1e0692d42ee4935a7e1ae7fec1913ddab3054f2 | [
"Apache-2.0"
] | null | null | null | lib/python3.8/site-packages/django_elasticsearch_dsl_drf/tests/test_filtering_common.py | ervinpepic/Kodecta_media_catalog | c1e0692d42ee4935a7e1ae7fec1913ddab3054f2 | [
"Apache-2.0"
] | 7 | 2020-06-06T01:06:19.000Z | 2022-02-10T11:15:14.000Z | lib/python3.8/site-packages/django_elasticsearch_dsl_drf/tests/test_filtering_common.py | ervinpepic/Kodecta_media_catalog | c1e0692d42ee4935a7e1ae7fec1913ddab3054f2 | [
"Apache-2.0"
] | 1 | 2020-11-04T03:21:24.000Z | 2020-11-04T03:21:24.000Z | """
Test filtering backend.
"""
from __future__ import absolute_import
import unittest
from django.core.management import call_command
from nine.versions import DJANGO_GTE_1_10
import pytest
from rest_framework import status
from books import constants
import factories
from search_indexes.viewsets import BookDoc... | 28.347697 | 78 | 0.549271 |
73ee62a37dd5f30f248479ad30c732359e5174a7 | 6,125 | py | Python | ibis/backends/clickhouse/tests/test_client.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2020-08-19T03:36:26.000Z | 2020-08-19T03:36:26.000Z | ibis/backends/clickhouse/tests/test_client.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | null | null | null | ibis/backends/clickhouse/tests/test_client.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 2 | 2020-11-27T22:21:50.000Z | 2021-04-03T09:36:25.000Z | from io import StringIO
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.config as config
import ibis.expr.types as ir
from ibis import literal as L
pytest.importorskip('clickhouse_driver')
pytestmark = pytest.mark.clickhouse
def test_get_table_ref(db):
table = db.functiona... | 27.10177 | 75 | 0.673959 |
73ee67a911741d61a820c72ec5b875112bdbb96d | 589 | py | Python | var/spack/repos/builtin/packages/r-leaps/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-leaps/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-01-08T22:23:53.000Z | 2022-03-30T11:08:17.000Z | var/spack/repos/builtin/packages/r-leaps/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RLeaps(RPackage):
"""leaps: Regression Subset Selection"""
homepage = "https://cloud.... | 34.647059 | 93 | 0.740238 |
73eea61795e3fa2a626d184f24b5dafb0c014615 | 1,452 | py | Python | test/test_user_permission.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | test/test_user_permission.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | test/test_user_permission.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import... | 25.928571 | 87 | 0.660468 |
73ef0362a27033e1024f5bb0212f1eaa45758e13 | 18,659 | py | Python | back/api/serializers.py | endorria/geoshop2 | 2a558710fedfaeb2319ba36bc84f4fc956e5f370 | [
"BSD-3-Clause"
] | null | null | null | back/api/serializers.py | endorria/geoshop2 | 2a558710fedfaeb2319ba36bc84f4fc956e5f370 | [
"BSD-3-Clause"
] | null | null | null | back/api/serializers.py | endorria/geoshop2 | 2a558710fedfaeb2319ba36bc84f4fc956e5f370 | [
"BSD-3-Clause"
] | null | null | null | import json
import copy
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
from django.contrib.auth.tokens import default_token_generator
from django.contrib.gis.gdal import GDALException
from django.contrib.gis.geos i... | 33.201068 | 107 | 0.657163 |
73ef60f1c12f46a115767d410043537bffc8cbbe | 20,020 | py | Python | tf_agents/utils/eager_utils_test.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | null | null | null | tf_agents/utils/eager_utils_test.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | null | null | null | tf_agents/utils/eager_utils_test.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 35.061296 | 82 | 0.685365 |
73efdfd63c8f43ce97aa52580cb741308de9a835 | 3,263 | py | Python | logya/server.py | yaph/logya | 9647f58a0b8653b56ad64332e235a76cab3acda9 | [
"MIT"
] | 12 | 2015-03-04T03:23:56.000Z | 2020-11-17T08:09:17.000Z | logya/server.py | elaOnMars/logya | a9f256ac8840e21b348ac842b35683224e25b613 | [
"MIT"
] | 78 | 2015-01-05T11:40:41.000Z | 2022-01-23T21:05:39.000Z | logya/server.py | elaOnMars/logya | a9f256ac8840e21b348ac842b35683224e25b613 | [
"MIT"
] | 6 | 2015-04-20T06:58:42.000Z | 2022-01-31T00:36:29.000Z | # -*- coding: utf-8 -*-
import http.server
import socketserver
from shutil import copyfile
from urllib.parse import unquote, urlparse
from logya.core import Logya
from logya.content import read, write_collection, write_page
from logya.template import env
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler... | 35.857143 | 107 | 0.676984 |
73eff2d6f52986eb40a45e562536088394182a2f | 786 | py | Python | crypto.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | crypto.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | crypto.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from Crypto.Cipher import AES
from Crypto import Random
import base64
class MightyCrypto:
block_size = AES.block_size
cipher_method = AES
__pad = lambda self,s: s + (self.block_size - len(s) % self.block_size) * chr(self.block_size - len(s) % self.block_size)
__unpad = lambda self,s: s[:-ord(s[len(s) ... | 35.727273 | 125 | 0.659033 |
73eff44e441e6872513ad393f4b1202ea079c5eb | 2,255 | py | Python | test/integration_test.py | JNRowe-retired/restfulie-py | 8ac2bc401068c7bae6da3d107b004835618165d7 | [
"Apache-2.0"
] | 3 | 2015-03-09T09:17:46.000Z | 2016-05-03T02:51:25.000Z | test/integration_test.py | JNRowe-retired/restfulie-py | 8ac2bc401068c7bae6da3d107b004835618165d7 | [
"Apache-2.0"
] | null | null | null | test/integration_test.py | JNRowe-retired/restfulie-py | 8ac2bc401068c7bae6da3d107b004835618165d7 | [
"Apache-2.0"
] | 1 | 2020-12-14T23:23:26.000Z | 2020-12-14T23:23:26.000Z | from restfulie.restfulie import Restfulie
from threading import Semaphore
class integration_test:
def should_perform_ordinary_requests(self):
body = Restfulie.at("http://localhost:20144/hello").get().body
assert "Response for" in body
assert "/hello" in body
def should_perform_reques... | 33.656716 | 78 | 0.627494 |
73f0114394700e2ee038acddf776bd307c2784f0 | 106 | py | Python | hfpy_code/chapter8/page264.py | leobarros/use_cabeca_python | 4e0897a68fb7ef669ec05eab7cba9412baa0e85e | [
"Apache-2.0"
] | 1 | 2016-04-01T04:31:52.000Z | 2016-04-01T04:31:52.000Z | hfpython_code/hfpy_code/chapter8/page264.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | null | null | null | hfpython_code/hfpy_code/chapter8/page264.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | 1 | 2020-06-02T17:47:22.000Z | 2020-06-02T17:47:22.000Z | import android
app = android.Android()
msg = "Hello from Head First Python on Android"
app.makeToast(msg)
| 21.2 | 47 | 0.764151 |
73f01c9b789f762f2c6d2f9a2f7b79f9c6dc8b23 | 555 | py | Python | DailyCodingProblem/85_Facebook_Conditional_Ops_Using_Math_on_32bit_Ints.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 5 | 2019-09-07T17:31:17.000Z | 2022-03-05T09:59:46.000Z | DailyCodingProblem/85_Facebook_Conditional_Ops_Using_Math_on_32bit_Ints.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | null | null | null | DailyCodingProblem/85_Facebook_Conditional_Ops_Using_Math_on_32bit_Ints.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 2 | 2019-09-07T17:31:24.000Z | 2019-10-28T16:10:52.000Z | """
This problem was asked by Facebook.
Given three 32-bit integers x, y, and b, return x if b is 1 and y if b is 0,
using only mathematical or bit operations. You can assume b can only be 1 or 0.
"""
import numpy as np
def conditional_op(x, y, b):
condition_1 = (b ^ np.uint32(0))
condition_2 = (b ^ np.uint3... | 22.2 | 79 | 0.637838 |
73f02c01c038aac22cc29387c7f5836f6d3ddbfd | 5,901 | py | Python | test/conftest.py | javister/krista-backup | f8852c20afdf483e842ff22497bdd80eedc30c78 | [
"Apache-2.0"
] | 7 | 2020-07-28T06:53:02.000Z | 2022-03-18T05:23:03.000Z | test/conftest.py | javister/krista-backup | f8852c20afdf483e842ff22497bdd80eedc30c78 | [
"Apache-2.0"
] | 1 | 2020-11-25T16:13:26.000Z | 2020-11-25T16:13:26.000Z | test/conftest.py | javister/krista-backup | f8852c20afdf483e842ff22497bdd80eedc30c78 | [
"Apache-2.0"
] | 1 | 2020-07-28T13:47:09.000Z | 2020-07-28T13:47:09.000Z | # -*- encoding: utf-8 -*-
import os
import secrets
import tarfile
import docker
import pytest
from .docker_utils import INFINITY_PROCESS, CONTAINERS_OPTS, ENV
def pytest_addoption(parser):
"""Реализация дополнительных опций.
Добавляет опции для выбора тестируемых версий python3,
подверсия передаётся ц... | 28.785366 | 78 | 0.618709 |
73f049df8cec66fe88bc870c0ecc4353f4babe36 | 16,300 | py | Python | rotkehlchen/kraken.py | michaelsproul/rotkehlchen | 410987682c02919dfd4f4b025836c5c191782b35 | [
"BSD-3-Clause"
] | 1 | 2021-04-23T21:50:19.000Z | 2021-04-23T21:50:19.000Z | rotkehlchen/kraken.py | iamonuwa/rotkehlchen | 6f237830bd5ad14d0b8f95a4e77cdeebfe671759 | [
"BSD-3-Clause"
] | null | null | null | rotkehlchen/kraken.py | iamonuwa/rotkehlchen | 6f237830bd5ad14d0b8f95a4e77cdeebfe671759 | [
"BSD-3-Clause"
] | 1 | 2021-12-19T20:01:30.000Z | 2021-12-19T20:01:30.000Z | #!/usr/bin/env python
#
# Good kraken and python resource:
# https://github.com/zertrin/clikraken/tree/master/clikraken
import hmac
import hashlib
import base64
import time
from urllib.parse import urlencode
from requests import Response
from rotkehlchen.utils import (
query_fiat_pair,
retry_calls,
rlk_jso... | 34.029228 | 87 | 0.550123 |
73f05be05a0ca9a51041c2b53ba4ced655fcdaba | 5,758 | py | Python | adv_exp/mi_fgsm_attack.py | alessandrodepalma/oval-bab | 014b6ee5071508430c8e515bbae725306db68fe1 | [
"MIT"
] | 6 | 2021-06-28T18:06:53.000Z | 2022-03-09T09:00:50.000Z | adv_exp/mi_fgsm_attack.py | alessandrodepalma/oval-bab | 014b6ee5071508430c8e515bbae725306db68fe1 | [
"MIT"
] | null | null | null | adv_exp/mi_fgsm_attack.py | alessandrodepalma/oval-bab | 014b6ee5071508430c8e515bbae725306db68fe1 | [
"MIT"
] | 2 | 2021-06-28T18:06:13.000Z | 2021-09-03T11:24:26.000Z | import torch
import random
import math
import torch.nn as nn
import torch.distributions as dist
from adv_exp.attack_class import Attack_Class
default_params = {
'iters': 40,
'optimizer': None,
'num_adv_ex': 5,
'lr': 1e-4,
'check_adv': 100,
'mu': 0.1,
'decay_alpha... | 38.386667 | 98 | 0.521883 |
73f0e5998a1e76cd9e18d354a5608364237f2c33 | 5,251 | py | Python | controllers/sync.py | gurlinthewurld/eden | 726aea55c95ee33f48dace63f76496e22e529157 | [
"MIT"
] | 1 | 2018-01-06T12:58:32.000Z | 2018-01-06T12:58:32.000Z | controllers/sync.py | gurlinthewurld/eden | 726aea55c95ee33f48dace63f76496e22e529157 | [
"MIT"
] | null | null | null | controllers/sync.py | gurlinthewurld/eden | 726aea55c95ee33f48dace63f76496e22e529157 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Synchronization Controllers """
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
module_name = T("Synchronization")
response.title = module_name
return dict(module_name=module_name)
# ---... | 36.72028 | 92 | 0.394782 |
73f0fb16e6a93eff1e85e69b197fbe2c876265a0 | 1,433 | py | Python | channels_graphql_ws/__init__.py | Abnormally/DjangoChannelsGraphqlWs | f741c20706901fc37f37fe08f6894c5614d2ab7d | [
"MIT"
] | 259 | 2018-06-27T12:33:54.000Z | 2022-03-26T23:09:04.000Z | channels_graphql_ws/__init__.py | Abnormally/DjangoChannelsGraphqlWs | f741c20706901fc37f37fe08f6894c5614d2ab7d | [
"MIT"
] | 83 | 2018-06-27T15:04:25.000Z | 2022-03-12T19:05:40.000Z | channels_graphql_ws/__init__.py | Abnormally/DjangoChannelsGraphqlWs | f741c20706901fc37f37fe08f6894c5614d2ab7d | [
"MIT"
] | 59 | 2018-07-02T20:29:07.000Z | 2022-03-12T16:10:53.000Z | # Copyright (C) DATADVANCE, 2010-2021
#
# 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, merge, publish,
# ... | 43.424242 | 72 | 0.795534 |
73f16f43edffb9b2e1d443a60cf1f6ccf30912ae | 2,824 | py | Python | server/danesfield_server/workflow_steps/run_metrics.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 25 | 2018-12-19T08:45:13.000Z | 2022-03-27T14:20:42.000Z | server/danesfield_server/workflow_steps/run_metrics.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 10 | 2018-11-30T22:21:45.000Z | 2022-01-21T19:43:47.000Z | server/danesfield_server/workflow_steps/run_metrics.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 7 | 2018-12-03T21:42:53.000Z | 2021-09-07T17:09:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Contributors
# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)
# See accompanying Copyright.txt and LICENSE files for details
##########... | 33.223529 | 79 | 0.641289 |
73f180acd83494861d9d4e2a6197ebf2703c1eba | 785 | py | Python | tests/test_preprocessing.py | chiragjn/laserembeddings | 37f2aaf723966f24fe0a8d473241725fba46f691 | [
"BSD-3-Clause"
] | null | null | null | tests/test_preprocessing.py | chiragjn/laserembeddings | 37f2aaf723966f24fe0a8d473241725fba46f691 | [
"BSD-3-Clause"
] | null | null | null | tests/test_preprocessing.py | chiragjn/laserembeddings | 37f2aaf723966f24fe0a8d473241725fba46f691 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from laserembeddings import Laser
from laserembeddings.preprocessing import Tokenizer, BPE
def test_tokenizer():
assert Tokenizer('en').tokenize("Let's do it!") == "let 's do it !"
with pytest.raises(NotImplementedError):
Tokenizer(romanize=True)
assert Tokenizer(
'en', de... | 30.192308 | 78 | 0.643312 |
73f18503c8e32506b63fd04d9956c916f3709ae9 | 3,363 | py | Python | Gamle scripts/old tests/systematic_L2.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | 2 | 2018-10-10T09:32:34.000Z | 2019-03-28T08:42:31.000Z | Gamle scripts/old tests/systematic_L2.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | null | null | null | Gamle scripts/old tests/systematic_L2.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 9 09:57:18 2018
@author: Simon
"""
import os
from createLargerFeatureMatrix import simpleLargeMatrix
import pickle
from keras.models import Sequential
from keras.layers import Dense
from keras import regularizers
import numpy as np
path = "Save... | 24.727941 | 137 | 0.708296 |
73f195bec7d93819944b73e253d44348b8a38f7b | 5,406 | py | Python | userbot/plugins/afk.py | darklord9899/IndianBot | 03ca4d44e42c4d4bfa0a38d2f780e1c912bc8625 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | darklord9899/IndianBot | 03ca4d44e42c4d4bfa0a38d2f780e1c912bc8625 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | darklord9899/IndianBot | 03ca4d44e42c4d4bfa0a38d2f780e1c912bc8625 | [
"MIT"
] | null | null | null | """AFK Plugin for IndianBot
Syntax: .afk REASON"""
import asyncio
import datetime
from telethon import events
from telethon.tl import functions, types
from userbot.utils import admin_cmd
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global last_afk_message # pylint:disable=E0602
USER... | 40.646617 | 126 | 0.596929 |
73f195cd3e7abad86c55285d4fc2cc5c530b71ba | 5,968 | py | Python | recipes/thesis_experiments_fsn/leakage_removal/fullsubnet_aec/fsn_informed_subband_baseline.py | wimmerb/SpeechEnhancers | 6b4bb708eb25901056615880d4e95d5fc5add48b | [
"MIT"
] | null | null | null | recipes/thesis_experiments_fsn/leakage_removal/fullsubnet_aec/fsn_informed_subband_baseline.py | wimmerb/SpeechEnhancers | 6b4bb708eb25901056615880d4e95d5fc5add48b | [
"MIT"
] | null | null | null | recipes/thesis_experiments_fsn/leakage_removal/fullsubnet_aec/fsn_informed_subband_baseline.py | wimmerb/SpeechEnhancers | 6b4bb708eb25901056615880d4e95d5fc5add48b | [
"MIT"
] | null | null | null | import torch
from torch.nn import functional
from audio_zen.acoustics.feature import drop_band
from audio_zen.model.base_model import BaseModel
from audio_zen.model.module.sequence_model import SequenceModel
class Model(BaseModel):
def __init__(self,
num_freqs,
look_ahead,
... | 40.324324 | 141 | 0.602379 |
73f1c8361b2c932e26c4b0aa51c5c23ca620ae03 | 63,412 | py | Python | Tools/msi/msi.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 164 | 2015-01-04T07:04:07.000Z | 2022-01-06T03:18:56.000Z | Tools/msi/msi.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 3 | 2015-08-27T07:35:26.000Z | 2016-04-07T16:35:39.000Z | Tools/msi/msi.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 35 | 2015-06-11T05:35:55.000Z | 2022-01-11T19:32:00.000Z | # Python MSI Generator
# (C) 2003 Martin v. Loewis
# See "FOO" in comments refers to MSDN sections with the title FOO.
import msilib, schema, sequence, os, glob, time, re, shutil, zipfile
import subprocess, tempfile
from msilib import Feature, CAB, Directory, Dialog, Binary, add_data
import uisample
from win32com.clien... | 44.499649 | 196 | 0.601873 |
73f1d4d802bc7b0ac1fa717d2a19529b691ca757 | 3,274 | py | Python | vscoscrape/constants.py | mvabdi/vsco-scraper | c95bcc0a8f434144dd80754e9ee0524a916a6141 | [
"MIT"
] | 94 | 2018-01-24T20:49:04.000Z | 2022-03-20T12:26:30.000Z | vscoscrape/constants.py | mvabdi/VSCOScrape | 190a6a167b8aed2b4cfff9dcd5e4c92238a78345 | [
"MIT"
] | 22 | 2018-04-09T21:33:20.000Z | 2022-03-28T23:22:11.000Z | vscoscrape/constants.py | mvabdi/VSCOScrape | 190a6a167b8aed2b4cfff9dcd5e4c92238a78345 | [
"MIT"
] | 25 | 2018-02-14T01:38:56.000Z | 2021-12-27T22:11:21.000Z | #!/usr/bin/env python3
# This file holds the constants used in the scraper object
import random
user_agents = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)... | 52.806452 | 134 | 0.648137 |
73f22609ed8a51b3bb692b848e8ff427af4f3471 | 13 | py | Python | v0.90/dc/models/__init__.py | iaiting/Flask-and-pywebview-followup-application-gui | b665334403b4a8471b5f28054ee2dc7adda7d9fc | [
"MIT"
] | 53 | 2015-01-15T04:38:29.000Z | 2022-01-26T12:34:14.000Z | script.module.ytpsearch/resources/__init__.py | muaddibttv/tantrumrepo | f5529dfb072cfe0c621db22374daf1456fe00c12 | [
"Beerware"
] | 2 | 2016-11-24T09:24:34.000Z | 2018-10-29T06:55:07.000Z | script.module.ytpsearch/resources/__init__.py | muaddibttv/tantrumrepo | f5529dfb072cfe0c621db22374daf1456fe00c12 | [
"Beerware"
] | 8 | 2018-04-03T15:46:42.000Z | 2020-07-17T18:12:11.000Z | #Nothing here | 13 | 13 | 0.846154 |
73f22b024976c68d28f46e927100e8915f3c9f4b | 14,679 | py | Python | ninecms/admin.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 49 | 2015-11-17T16:18:02.000Z | 2021-12-10T15:01:03.000Z | ninecms/admin.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 39 | 2015-11-18T12:20:14.000Z | 2022-01-19T10:47:19.000Z | ninecms/admin.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 9 | 2016-04-07T12:12:05.000Z | 2021-02-04T15:42:02.000Z | """ Admin objects declaration for Nine CMS """
__author__ = 'George Karakostas'
__copyright__ = 'Copyright 2015, George Karakostas'
__licence__ = 'BSD-3'
__email__ = 'gkarak@9-dev.com'
from django.contrib import admin, messages
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
fr... | 41.349296 | 116 | 0.637373 |
73f23b53888497de3bab3a71d9bd788505b06db6 | 118,239 | py | Python | resources/gethisco.py | LvanWissen/saa-bevolkingsregisters | 07beb9b5a7a171c1aa07c5a86d691ada51b5fef4 | [
"MIT"
] | null | null | null | resources/gethisco.py | LvanWissen/saa-bevolkingsregisters | 07beb9b5a7a171c1aa07c5a86d691ada51b5fef4 | [
"MIT"
] | null | null | null | resources/gethisco.py | LvanWissen/saa-bevolkingsregisters | 07beb9b5a7a171c1aa07c5a86d691ada51b5fef4 | [
"MIT"
] | null | null | null | """sparql
SERVICE <https://api.druid.datalegend.net/datasets/iisg/HISCO/services/HISCO/sparql> {
?hiscoOccupation a schema:Occupation ;
schema:name ?occName ; # NB Dit matcht op hoofdletters + taal.
schema:occupationalCategory ?hiscoCategory .
?hiscoCategory schema:codeValue ?hiscoCode ;
... | 21.354344 | 86 | 0.765847 |
73f263129a82f143d758fcbf71d3d23beb3dfb73 | 1,246 | py | Python | generation/pycocoevalcap/bleu/bleu.py | yangliuy/Hybrid-Neural-Conversation-Model | 329a9310b2608ed1c04d17285a16a7170d6d4703 | [
"Apache-2.0"
] | 22 | 2019-09-23T20:14:54.000Z | 2022-02-24T20:49:35.000Z | generation/pycocoevalcap/bleu/bleu.py | yangliuy/Hybrid-Neural-Conversation-Model | 329a9310b2608ed1c04d17285a16a7170d6d4703 | [
"Apache-2.0"
] | 2 | 2019-08-31T08:41:14.000Z | 2020-10-03T21:10:34.000Z | generation/pycocoevalcap/bleu/bleu.py | yangliuy/Hybrid-Neural-Conversation-Model | 329a9310b2608ed1c04d17285a16a7170d6d4703 | [
"Apache-2.0"
] | 3 | 2019-11-07T03:03:53.000Z | 2020-10-23T15:50:44.000Z | #!/usr/bin/env python
#
# File Name : bleu.py
#
# Description : Wrapper for BLEU scorer.
#
# Creation Date : 06-01-2015
# Last Modified : Thu 19 Mar 2015 09:13:28 PM PDT
# Authors : Hao Fang <hfang@uw.edu> and Tsung-Yi Lin <tl483@cornell.edu>
from bleu_scorer import BleuScorer
class Bleu:
def __init__(self, n=4... | 25.958333 | 79 | 0.58427 |
73f2939dd8bda2255e3aa7d2b351df488d5e0e83 | 5,027 | py | Python | datawinners/project/views/create_questionnaire.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/project/views/create_questionnaire.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/project/views/create_questionnaire.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | import json
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext as _, ugettext
from django.view... | 54.053763 | 150 | 0.719714 |
73f2aa3ca4ceda465bc9892c2741471244e7173e | 759 | py | Python | sample/common.py | camilastock/opendxl-nmap-client-python | 2221adcb154a412c14925935159afc67ed9ba7a5 | [
"Apache-2.0"
] | 1 | 2017-10-11T22:26:16.000Z | 2017-10-11T22:26:16.000Z | sample/common.py | ndcolter-mcafee/opendxl-threatevent-client-python | b6a3fe8621ae2809f1c7c718a2c4350e868e830f | [
"Apache-2.0"
] | null | null | null | sample/common.py | ndcolter-mcafee/opendxl-threatevent-client-python | b6a3fe8621ae2809f1c7c718a2c4350e868e830f | [
"Apache-2.0"
] | 1 | 2018-02-12T18:20:18.000Z | 2018-02-12T18:20:18.000Z | """
Common definitions for the samples.
This includes the defining the path to the configuration file used to initialize the DXL client
in addition to setting up the logger appropriately.
"""
import os
import logging
# Config file name.
CONFIG_FILE_NAME = "dxlclient.config"
CONFIG_FILE = os.path.dirname(os.path.abspa... | 31.625 | 95 | 0.778656 |
73f2b7fc414ae7cdc185458ae691be0018e15043 | 5,321 | py | Python | n_utils/cloudfront_utils.py | NitorCreations/nitor-deploy-tools | 93dd86d5e6586520f72dd38319f55849bf4a5bc5 | [
"Apache-2.0"
] | 10 | 2017-02-12T17:04:56.000Z | 2018-11-10T16:46:57.000Z | n_utils/cloudfront_utils.py | NitorCreations/nitor-deploy-tools | 93dd86d5e6586520f72dd38319f55849bf4a5bc5 | [
"Apache-2.0"
] | 22 | 2017-04-06T11:41:01.000Z | 2019-09-18T05:45:03.000Z | n_utils/cloudfront_utils.py | NitorCreations/nitor-deploy-tools | 93dd86d5e6586520f72dd38319f55849bf4a5bc5 | [
"Apache-2.0"
] | 1 | 2020-08-26T07:32:02.000Z | 2020-08-26T07:32:02.000Z | #!/usr/bin/env python
# Copyright 2017 Nitor Creations Oy
#
# 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... | 37.737589 | 104 | 0.607029 |
73f312d21e6fb6971fe47e26f6090204f1835f5b | 1,849 | py | Python | gwtarget/DESI_mainInjector/Main-Injector-master/python/kasen_modelspace.py | rknop/timedomain | d3e3c43dfbb9cadc150ea04024d9b4132cb9ca17 | [
"MIT"
] | 1 | 2021-06-18T05:25:27.000Z | 2021-06-18T05:25:27.000Z | gwtarget/DESI_mainInjector/Main-Injector-master/python/kasen_modelspace.py | MatthewPortman/timedomain | b9c6c2e6804d7dde56311d9402769be545d505d0 | [
"MIT"
] | null | null | null | gwtarget/DESI_mainInjector/Main-Injector-master/python/kasen_modelspace.py | MatthewPortman/timedomain | b9c6c2e6804d7dde56311d9402769be545d505d0 | [
"MIT"
] | null | null | null | import os
import numpy as np
from knlc import kn_brightness_estimate
def run_ap_mag_for_kasen_models (filter, distance, dist_err, days_since_burst,
kasen_fraction, data_dir="./", fast=False, doPlots=True) :
report_file = data_dir + "/kn_report"
if not fast :
knlc_dir = os.getenv("DESGW_DIR", "... | 39.340426 | 93 | 0.608437 |
73f33c018d551c0327e64f5c322c6b826b0969c3 | 1,868 | py | Python | Executor/lib/conn_device.py | DPham-Xyk/CoreNet | 4d36529ae6e51d5fa8cf95be58704ddab10a54c0 | [
"MIT"
] | null | null | null | Executor/lib/conn_device.py | DPham-Xyk/CoreNet | 4d36529ae6e51d5fa8cf95be58704ddab10a54c0 | [
"MIT"
] | null | null | null | Executor/lib/conn_device.py | DPham-Xyk/CoreNet | 4d36529ae6e51d5fa8cf95be58704ddab10a54c0 | [
"MIT"
] | null | null | null | import logging
import yaml
from jnpr.junos import Device
from jnpr.junos.exception import ConnectError
# Logging
logger = logging.getLogger(__name__)
class ConnDevice(object):
def __init__(self, config_path='config/devices.yaml'):
"""Common interface for connecting to Junos network devices.
:par... | 35.245283 | 93 | 0.650964 |
73f33df3382aa07570398b499fd966281c1dd7c0 | 2,527 | py | Python | src/null_player.py | c3n21/hidamari | 776e9ca0415a80759fdf9feab53d883b56d868d5 | [
"Apache-2.0"
] | 89 | 2020-12-29T02:10:47.000Z | 2022-03-31T05:50:41.000Z | src/null_player.py | c3n21/hidamari | 776e9ca0415a80759fdf9feab53d883b56d868d5 | [
"Apache-2.0"
] | 42 | 2020-12-29T02:14:03.000Z | 2022-03-29T08:34:21.000Z | src/null_player.py | c3n21/hidamari | 776e9ca0415a80759fdf9feab53d883b56d868d5 | [
"Apache-2.0"
] | 13 | 2020-12-29T02:10:49.000Z | 2022-03-05T21:45:47.000Z | import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
from base_player import BasePlayer
from commons import *
class NullPlayer(BasePlayer):
def __init__(self, config):
super().__init__(config)
self.start_all_monitors()
self.menu = self._build_context_menu()
... | 28.393258 | 110 | 0.617333 |
73f355fa31f66730c6f5e10e7354ad9d4e5129c8 | 15,663 | py | Python | src/hades/bin/dhcp_script.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 8 | 2015-04-27T00:41:03.000Z | 2021-11-14T17:15:26.000Z | src/hades/bin/dhcp_script.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 84 | 2015-04-27T12:15:00.000Z | 2021-11-28T19:06:23.000Z | src/hades/bin/dhcp_script.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 4 | 2015-11-14T16:20:40.000Z | 2017-09-05T00:27:49.000Z | from __future__ import annotations
import argparse
import codecs
import grp
import itertools
import logging
import os
import pwd
from contextlib import closing
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from typing import Any, Callable, Dict, Iterable, Optional, Tuple, TypeVar,... | 30.711765 | 95 | 0.634297 |
73f3902b17cc1a34e9178bd9c760c6d389418ea4 | 734 | py | Python | modelConfigs/ModelN.py | jesisca-tandi/video-actions-classification | c90aafc9d212982368565fc373ac7fd0ff08e1d6 | [
"MIT"
] | null | null | null | modelConfigs/ModelN.py | jesisca-tandi/video-actions-classification | c90aafc9d212982368565fc373ac7fd0ff08e1d6 | [
"MIT"
] | null | null | null | modelConfigs/ModelN.py | jesisca-tandi/video-actions-classification | c90aafc9d212982368565fc373ac7fd0ff08e1d6 | [
"MIT"
] | null | null | null | from keras.models import Sequential, load_model
from keras.layers import Dense, Dropout, Flatten, Conv1D, Conv2D, MaxPooling2D, Embedding, LSTM, TimeDistributed, Masking, Lambda, GRU, Bidirectional, LeakyReLU
from keras.optimizers import Adam
def createModel(modelName='ModelN'):
opt = Adam(lr=0.005)
model =... | 40.777778 | 160 | 0.747956 |
73f3b3c2c4a8524c61972a7a6fd62caf64dad099 | 11,641 | py | Python | avalon/mongodb.py | simonebarbieri/avalon-core | cfd4191e364b47de7364096f45d9d9d9a901692a | [
"MIT"
] | null | null | null | avalon/mongodb.py | simonebarbieri/avalon-core | cfd4191e364b47de7364096f45d9d9d9a901692a | [
"MIT"
] | null | null | null | avalon/mongodb.py | simonebarbieri/avalon-core | cfd4191e364b47de7364096f45d9d9d9a901692a | [
"MIT"
] | null | null | null | import os
import sys
import time
import functools
import logging
import pymongo
import ctypes
from uuid import uuid4
from avalon import schema
def extract_port_from_url(url):
if sys.version_info[0] == 2:
from urlparse import urlparse
else:
from urllib.parse import urlparse
parsed_url = ur... | 27.585308 | 74 | 0.577012 |
73f3bd198dd98091e99fdec05b1c9b2d540b9dbe | 1,620 | py | Python | python/__init__.py | aska-0096/iGEMMgen | cff8507355d86e47f5b099cd9b8a81d94fab93d7 | [
"MIT"
] | 20 | 2020-04-14T14:39:24.000Z | 2022-02-23T19:37:04.000Z | python/__init__.py | aska-0096/iGEMMgen | cff8507355d86e47f5b099cd9b8a81d94fab93d7 | [
"MIT"
] | 38 | 2020-04-21T12:23:07.000Z | 2021-12-31T02:26:21.000Z | python/__init__.py | ROCmSoftwarePlatform/MISA | 7ced4086588377dabb347d8a21d7d3a704a28188 | [
"MIT"
] | 9 | 2020-04-20T06:34:16.000Z | 2022-02-23T19:37:06.000Z | ################################################################################
#
# MIT License
#
# Copyright (c) 2020-2021 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... | 41.538462 | 81 | 0.676543 |
73f3c82aa520a47f00c263255f2e453034ef9b7f | 5,040 | py | Python | sparv/modules/hunpos/morphtable_hist.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | 17 | 2018-09-21T07:01:45.000Z | 2022-02-24T23:26:49.000Z | sparv/modules/hunpos/morphtable_hist.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | 146 | 2018-11-13T19:13:25.000Z | 2022-03-31T09:57:56.000Z | sparv/modules/hunpos/morphtable_hist.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | 5 | 2019-02-14T00:50:38.000Z | 2021-03-29T15:37:41.000Z | """Make morphtable for Swedish historical resources."""
import re
import sparv.util as util
from sparv import Model, ModelOutput, modelbuilder
# Constants
SALDO_TO_SUC = util.tagsets.mappings["saldo_to_suc"]
SALDO_TO_SUC["pm"] = {"PM.NOM"}
SALDO_TO_SUC["nl invar"] = {"NL.NOM"}
@modelbuilder("Hunpos morphtable for ... | 41.652893 | 110 | 0.628175 |
73f3e906e1322bca38dc0df14f78b58884386c45 | 2,958 | py | Python | components/shelly/switch.py | tefinger/hass | 30b58902b887bdfc39f65783cbf964fb56bfb1ca | [
"MIT"
] | null | null | null | components/shelly/switch.py | tefinger/hass | 30b58902b887bdfc39f65783cbf964fb56bfb1ca | [
"MIT"
] | null | null | null | components/shelly/switch.py | tefinger/hass | 30b58902b887bdfc39f65783cbf964fb56bfb1ca | [
"MIT"
] | null | null | null | """
Shelly platform for the switch component.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/shelly/
"""
import logging
from homeassistant.components.switch import SwitchDevice
from homeassistant.helpers.entity import ToggleEntity
# from .sen... | 29.287129 | 72 | 0.630156 |
73f3f75fea02f76c887322fb5db2ad6bd8dec9b2 | 16,889 | py | Python | ENCODE_controlled_by_backfill.py | T2DREAM/pyencoded-tools | 75fa636995bfc9fe181f9af490ce70dde3f6ce21 | [
"MIT"
] | null | null | null | ENCODE_controlled_by_backfill.py | T2DREAM/pyencoded-tools | 75fa636995bfc9fe181f9af490ce70dde3f6ce21 | [
"MIT"
] | null | null | null | ENCODE_controlled_by_backfill.py | T2DREAM/pyencoded-tools | 75fa636995bfc9fe181f9af490ce70dde3f6ce21 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: latin-1 -*-
import argparse
import os.path
import encodedcc
import sys
EPILOG = '''
Script to fix the controlled_by backfill problems
This is a dryrun default script, run with '--update' to PATCH data
Useage:
%(prog)s --infile MyFile.txt
%(prog)s --infile ENCSR000AAA
... | 46.019074 | 220 | 0.519214 |
73f3f970e787c02d1f35d2c8fa160399482e8fa5 | 2,029 | py | Python | spectrumdevice/__init__.py | KCL-BMEIS/spectrumdevice | f0eecbd1d3b58dc9a9f226c4c75d7f398b1ea551 | [
"MIT"
] | 4 | 2022-01-10T08:35:23.000Z | 2022-01-19T12:06:05.000Z | spectrumdevice/__init__.py | KCL-BMEIS/spectrumdevice | f0eecbd1d3b58dc9a9f226c4c75d7f398b1ea551 | [
"MIT"
] | 8 | 2022-01-05T14:07:10.000Z | 2022-03-17T20:03:27.000Z | spectrumdevice/__init__.py | KCL-BMEIS/spectrumdevice | f0eecbd1d3b58dc9a9f226c4c75d7f398b1ea551 | [
"MIT"
] | null | null | null | """
`spectrumdevice` is a high-level, object-oriented Python library for controlling Spectrum Instrumentation digitisers.
It can connect to individual digitisers or
[StarHubs](https://spectrum-instrumentation.com/en/m4i-star-hub) (e.g. the
[NetBox](https://spectrum-instrumentation.com/en/digitizernetbox)).
The main m... | 42.270833 | 120 | 0.79448 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.