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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74be40541ed52d3d130d98259c4e9a4a54d3644 | 3,070 | py | Python | office365/sharepoint/ui/applicationpages/clientPeoplePickerQueryParameters.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/sharepoint/ui/applicationpages/clientPeoplePickerQueryParameters.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/sharepoint/ui/applicationpages/clientPeoplePickerQueryParameters.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | from office365.runtime.client_value import ClientValue
from office365.sharepoint.principal.principalSource import PrincipalSource
from office365.sharepoint.principal.principalType import PrincipalType
class ClientPeoplePickerQueryParameters(ClientValue):
def __init__(self, queryString, allowEmailAddresses=True, ... | 60.196078 | 120 | 0.749511 |
f74be41a0b82d16d29e9badfcc3f1f244d2e6282 | 320 | py | Python | backend/src/app/schemas/bin.py | niikakralj/EESTEC-Team | be70366dfc249e200ade8deb84408e758123c499 | [
"MIT"
] | null | null | null | backend/src/app/schemas/bin.py | niikakralj/EESTEC-Team | be70366dfc249e200ade8deb84408e758123c499 | [
"MIT"
] | null | null | null | backend/src/app/schemas/bin.py | niikakralj/EESTEC-Team | be70366dfc249e200ade8deb84408e758123c499 | [
"MIT"
] | null | null | null | import datetime
from pydantic import BaseModel
class BinsOpened(BaseModel):
card_id: str
bin_id: int
bin_type: str
timestamp: datetime.datetime
weight: int
recycle_status_ok: bool = False
class BinsStatus(BaseModel):
bin_id: int
timestamp: datetime.datetime
waste_status: int
| 14.545455 | 35 | 0.7125 |
f74bee1552bd5c2cfc1aa8d349bc38fa0414f8a1 | 1,866 | py | Python | can-io-firmware/set_servo.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 40 | 2016-10-04T19:59:22.000Z | 2020-12-25T18:11:35.000Z | can-io-firmware/set_servo.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 209 | 2016-09-21T21:54:28.000Z | 2022-01-26T07:42:37.000Z | can-io-firmware/set_servo.py | greck2908/robot-software | 2e1e8177148a089e8883967375dde7f8ed3d878b | [
"MIT"
] | 21 | 2016-11-07T14:40:16.000Z | 2021-11-02T09:53:37.000Z | #!/usr/bin/env python3
"""
Sends a PWM via UAVCAN
"""
import argparse
import uavcan
import os
DSDL_DIR = os.path.join(os.path.dirname(__file__), "../uavcan_data_types/cvra")
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"port",
help="SocketCAN i... | 23.037037 | 88 | 0.608253 |
f74c06c1b4b99f15be38c16bb8537a174d705ec3 | 7,306 | py | Python | rlstructures/deprecated/batchers/buffers.py | Purple-PI/rlstructures | 9b201b083715bbda2f3534b010c84e11dfc0a1c7 | [
"MIT"
] | 281 | 2021-01-13T14:20:23.000Z | 2022-03-23T08:46:56.000Z | rlstructures/deprecated/batchers/buffers.py | Purple-PI/rlstructures | 9b201b083715bbda2f3534b010c84e11dfc0a1c7 | [
"MIT"
] | 2 | 2021-01-22T23:28:34.000Z | 2021-04-29T22:05:42.000Z | rlstructures/deprecated/batchers/buffers.py | Purple-PI/rlstructures | 9b201b083715bbda2f3534b010c84e11dfc0a1c7 | [
"MIT"
] | 13 | 2021-01-15T14:53:32.000Z | 2022-03-22T11:12:54.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 torch
import torch.multiprocessing as mp
from rlstructures import TemporalDictTensor, DictTensor
class Buffer:
def get_free_... | 33.209091 | 107 | 0.564057 |
f74c2f818b29270ec86cc6a228ac4b98548b96d6 | 15,213 | py | Python | Homework 4/107062240_hw4_train.py | ChristianLin0420/DeepRL | 143a9bfebd264229d9d26fcdc070065225774e04 | [
"MIT"
] | null | null | null | Homework 4/107062240_hw4_train.py | ChristianLin0420/DeepRL | 143a9bfebd264229d9d26fcdc070065225774e04 | [
"MIT"
] | null | null | null | Homework 4/107062240_hw4_train.py | ChristianLin0420/DeepRL | 143a9bfebd264229d9d26fcdc070065225774e04 | [
"MIT"
] | null | null | null | from osim.env import L2M2019Env
'''
TD3
'''
import copy
import numpy as np
import pandas as pd
import argparse
import os
import os.path
from os import path
import utils
from collections import Iterable
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda... | 34.186517 | 137 | 0.593243 |
f74c2fb39d5fcf882799632558ba265e2f829ff7 | 6,071 | py | Python | effector_database/views.py | LuukHenk/effector_database | d9702f89ffd2a23b4f5233d4ece69c1ceebd6164 | [
"MIT"
] | null | null | null | effector_database/views.py | LuukHenk/effector_database | d9702f89ffd2a23b4f5233d4ece69c1ceebd6164 | [
"MIT"
] | null | null | null | effector_database/views.py | LuukHenk/effector_database | d9702f89ffd2a23b4f5233d4ece69c1ceebd6164 | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from .models import Sequence
from .forms import SequenceForm
def index(request):
""" Redirec... | 40.205298 | 100 | 0.689837 |
f74c3b3c091e218276bfe1b1c8c61621dbd615e2 | 658 | py | Python | generate_dmrpp.py | amarouane-ABDELHAK/dmrpp-file-generator-docker | 85210b80d4204c5ca5325fe7167c7e1cd8ea62e8 | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | amarouane-ABDELHAK/dmrpp-file-generator-docker | 85210b80d4204c5ca5325fe7167c7e1cd8ea62e8 | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | amarouane-ABDELHAK/dmrpp-file-generator-docker | 85210b80d4204c5ca5325fe7167c7e1cd8ea62e8 | [
"Apache-2.0"
] | 1 | 2021-03-24T17:23:12.000Z | 2021-03-24T17:23:12.000Z | from os import listdir
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
if __name__ == "__main__":
workstation_path = "/workstation/"
join_path = lambda x: join(workstation_path, x)
input_files = [join_path(f) for f in listdir(workstation_path... | 43.866667 | 118 | 0.659574 |
f74c507307dbf6c175e0651753194a29d1feb1f8 | 38,578 | py | Python | PhenNorm/src/Similar_finding_v2.py | DBMI/iSeeDELVE | 72b51b275bd8ae2e1587f4b6709f24307dd6560f | [
"BSD-4-Clause-UC"
] | null | null | null | PhenNorm/src/Similar_finding_v2.py | DBMI/iSeeDELVE | 72b51b275bd8ae2e1587f4b6709f24307dd6560f | [
"BSD-4-Clause-UC"
] | null | null | null | PhenNorm/src/Similar_finding_v2.py | DBMI/iSeeDELVE | 72b51b275bd8ae2e1587f4b6709f24307dd6560f | [
"BSD-4-Clause-UC"
] | null | null | null | # This script cluster similar variables
# Written by Son Doan, January 2014
# Version 2.0 March 2014
# RUN:
# Example
# python Similar_finding_v2.py -d 1 -o "LabTest" -i ../data/200test/500LabTests_random_KWL.txt2_cat
"""
RULE SETS:
1. Medical History
Type=Medical History
AND
SOI= {Study Subject, Participant, Patien... | 30.233542 | 357 | 0.618461 |
f74c615471184ac9ab3bf5511e84c837815443df | 930 | py | Python | odfdo/version.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 18 | 2018-04-19T08:30:48.000Z | 2022-02-14T11:00:27.000Z | odfdo/version.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 15 | 2018-04-22T00:52:41.000Z | 2021-07-05T10:16:38.000Z | odfdo/version.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 6 | 2018-04-22T00:14:12.000Z | 2021-12-06T01:42:07.000Z | # Copyright 2018-2020 Jérôme Dumonteil
# Copyright (c) 2009-2012 Ars Aperta, Itaapy, Pierlis, Talend.
#
# 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/LI... | 38.75 | 74 | 0.755914 |
f74c7da14d5d5d8737fb278ca6bf9d0741d533e0 | 4,235 | py | Python | mcarch/views/mods.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | mcarch/views/mods.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | mcarch/views/mods.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, jsonify, request, url_for, redirect, flash, \
abort, current_app as app
from mcarch.model.mod import Mod, ModAuthor, ModVersion, GameVersion
from mcarch.model.mod.draft import DraftMod
from mcarch.model.mod.logs import LogMod, gen_diffs
from mcarch.model.user impor... | 36.508621 | 98 | 0.691854 |
f74cab154d9a09a50918d0af2a9ef62841faa0c8 | 1,897 | py | Python | scripts/dataToParquet.py | AeRabelais/bdt_pipeline | 35d0cc3f7ada35e082c384d0755916605daa5feb | [
"MIT"
] | null | null | null | scripts/dataToParquet.py | AeRabelais/bdt_pipeline | 35d0cc3f7ada35e082c384d0755916605daa5feb | [
"MIT"
] | null | null | null | scripts/dataToParquet.py | AeRabelais/bdt_pipeline | 35d0cc3f7ada35e082c384d0755916605daa5feb | [
"MIT"
] | null | null | null | """
@Title: dataToParquet.py
@author: Ashia Lewis
GOAL: Create and update the parquet files for the air and soil data, separately.
"""
import os
import glob
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
#CODE TO BE USED FOR THE BATCH DATA
"""
#file directories for the air and soi... | 27.1 | 81 | 0.727992 |
f74cee003c3c4f2391f62fefc98bc111aa961f18 | 29,998 | py | Python | synapseclient/utils.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | synapseclient/utils.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | synapseclient/utils.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | """
*****************
Utility Functions
*****************
Utility functions useful in the implementation and testing of the Synapse client.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import ... | 32.92865 | 178 | 0.634709 |
f74cf35b76e4ab4dbb98854f098dd2d45783cde0 | 424 | py | Python | libs/interface.py | spidermila/mikrotik_control | 65bf4405be180cf5073cdb129aa345df4ddfac52 | [
"MIT"
] | null | null | null | libs/interface.py | spidermila/mikrotik_control | 65bf4405be180cf5073cdb129aa345df4ddfac52 | [
"MIT"
] | null | null | null | libs/interface.py | spidermila/mikrotik_control | 65bf4405be180cf5073cdb129aa345df4ddfac52 | [
"MIT"
] | 1 | 2022-03-20T02:57:03.000Z | 2022-03-20T02:57:03.000Z | class Interface:
def __init__(
self,
number: int,
name: str,
disabled: bool,
running: bool,
slave: bool,
dynamic: bool,
comment: str,
) -> None:
self.number = number
self.name = name
self.disabled = disabled
self.run... | 22.315789 | 32 | 0.514151 |
f74d01e15784d436a563807618590b57448c0f48 | 3,730 | py | Python | xos/core/dashboard/views/interactions.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/core/dashboard/views/interactions.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | 5 | 2020-06-05T17:47:15.000Z | 2021-09-23T23:21:27.000Z | xos/core/dashboard/views/interactions.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | null | null | null | from view_common import *
class DashboardSliceInteractions(View):
def get(self, request, name="users", **kwargs):
colors = ["#005586", "#6ebe49", "orange", "#707170", "#00c4b3", "#077767", "dodgerblue", "#a79b94", "#c4e76a", "red"]
groups = []
matrix = []
slices = list(Slice.object... | 35.865385 | 125 | 0.551743 |
f74d025fc102159173e84e6023fcc9058865349c | 268 | py | Python | utils/util.py | daili0015/ModelFeast | 0689ced4d0f37be438d3a91908e5e4cc5b7d54b8 | [
"MIT"
] | 247 | 2019-03-05T07:12:29.000Z | 2022-03-29T01:51:17.000Z | utils/util.py | jungerschwarz/ModelFeast | 03afca0b129532135910ee2ac72a3b85be795289 | [
"MIT"
] | 8 | 2019-05-21T03:05:27.000Z | 2021-12-09T03:22:51.000Z | utils/util.py | jungerschwarz/ModelFeast | 03afca0b129532135910ee2ac72a3b85be795289 | [
"MIT"
] | 47 | 2019-03-05T07:14:13.000Z | 2021-11-11T01:04:28.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
def ensure_dir(path):
if not os.path.exists(path):
os.makedirs(path)
def get_instance(module, name, config, *args):
return getattr(module, config[name]['type'])(*args, **config[name]['args'])
| 20.615385 | 79 | 0.63806 |
f74d2ccd36714d8c8feb1fa3fdbdedb0c184a37b | 429 | py | Python | hstphot/read_ds9region.py | bkornpob/hstphot | eafaebc382450061690c5795ce350336801d8037 | [
"MIT"
] | null | null | null | hstphot/read_ds9region.py | bkornpob/hstphot | eafaebc382450061690c5795ce350336801d8037 | [
"MIT"
] | null | null | null | hstphot/read_ds9region.py | bkornpob/hstphot | eafaebc382450061690c5795ce350336801d8037 | [
"MIT"
] | null | null | null | import numpy as np
def read_ds9region(ds9regfile):
"""
Assume ds9regfile in the format as ds9, and coordinate system as image
"""
out = {}
f = open(ds9regfile,'r')
for i,ii in enumerate(f.readlines()):
if i < 3:
continue
x,y,_ = np.array(ii.split('(')[1].split(')')[0... | 26.8125 | 81 | 0.531469 |
f74d618ffd0980a092c540577b8989c31c36d997 | 20,645 | py | Python | zerver/lib/streams.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | 6 | 2019-05-09T20:43:20.000Z | 2022-03-29T05:53:50.000Z | zerver/lib/streams.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | 2 | 2016-10-18T04:01:56.000Z | 2016-10-20T18:19:09.000Z | zerver/lib/streams.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | 7 | 2016-08-10T02:24:32.000Z | 2022-03-28T15:14:18.000Z | from typing import Any, Iterable, List, Mapping, Optional, Set, Tuple, Union
from django.conf import settings
from django.db.models.query import QuerySet
from django.utils.translation import ugettext as _
from zerver.lib.bugdown import convert as bugdown_convert
from zerver.lib.request import JsonableError
from zerve... | 42.83195 | 109 | 0.675902 |
f74d9307c18f268eb92583ff062d93033f2347d6 | 1,333 | py | Python | python_solutions/fizz_buzz/codeeval_fizzbuzz.py | joelstanner/codeeval | ef0591fabcad39d45f10287d7a1330f342ab96e0 | [
"MIT"
] | null | null | null | python_solutions/fizz_buzz/codeeval_fizzbuzz.py | joelstanner/codeeval | ef0591fabcad39d45f10287d7a1330f342ab96e0 | [
"MIT"
] | null | null | null | python_solutions/fizz_buzz/codeeval_fizzbuzz.py | joelstanner/codeeval | ef0591fabcad39d45f10287d7a1330f342ab96e0 | [
"MIT"
] | null | null | null | """Accept a text file and do the fizzbuzz upon it.
Your program should accept a file as its first argument.
The file contains multiple separated lines; each line contains
3 numbers that are space delimited. The first number is the first
divider (X), the second number is the second divider (Y), and the
third number is ... | 23.385965 | 65 | 0.580645 |
f74dbc0edbbc975785b88e27d1296ba416992478 | 287 | py | Python | awswrangler/__metadata__.py | Kyruski/aws-data-wrangler | 2c240e398bef06d00a69ac690c23ffb50666df69 | [
"Apache-2.0"
] | null | null | null | awswrangler/__metadata__.py | Kyruski/aws-data-wrangler | 2c240e398bef06d00a69ac690c23ffb50666df69 | [
"Apache-2.0"
] | 56 | 2021-06-04T13:41:52.000Z | 2022-03-28T08:53:21.000Z | awswrangler/__metadata__.py | Kyruski/aws-data-wrangler | 2c240e398bef06d00a69ac690c23ffb50666df69 | [
"Apache-2.0"
] | 1 | 2022-02-06T02:04:32.000Z | 2022-02-06T02:04:32.000Z | """Metadata Module.
Source repository: https://github.com/awslabs/aws-data-wrangler
Documentation: https://aws-data-wrangler.readthedocs.io/
"""
__title__: str = "awswrangler"
__description__: str = "Pandas on AWS."
__version__: str = "2.12.1"
__license__: str = "Apache License 2.0"
| 23.916667 | 63 | 0.735192 |
f74dd43f7f25aee6abb1ef96f5623bb0c8999057 | 2,908 | py | Python | influxdb_client/domain/flux_response.py | kelseiv/influxdb-client-python | 9a0d2d659157cca96f6a04818fdeb215d699bdd7 | [
"MIT"
] | 1 | 2021-06-06T10:39:47.000Z | 2021-06-06T10:39:47.000Z | influxdb_client/domain/flux_response.py | kelseiv/influxdb-client-python | 9a0d2d659157cca96f6a04818fdeb215d699bdd7 | [
"MIT"
] | null | null | null | influxdb_client/domain/flux_response.py | kelseiv/influxdb-client-python | 9a0d2d659157cca96f6a04818fdeb215d699bdd7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Flux... | 25.734513 | 124 | 0.547455 |
f74de0e388005ba39e43708024aba7ca7ac8c7ff | 10,202 | py | Python | lreid/models/LwFnet.py | TPCD/LifelongReID | cb33f9c29fe398e7546db345fab1c338dda8252f | [
"MIT"
] | 63 | 2021-03-20T15:33:11.000Z | 2022-03-30T03:04:14.000Z | lreid/models/LwFnet.py | TPCD/LifelongReID | cb33f9c29fe398e7546db345fab1c338dda8252f | [
"MIT"
] | 5 | 2021-03-23T08:04:21.000Z | 2022-03-10T02:28:43.000Z | lreid/models/LwFnet.py | TPCD/LifelongReID | cb33f9c29fe398e7546db345fab1c338dda8252f | [
"MIT"
] | 10 | 2021-04-30T11:14:10.000Z | 2022-03-18T16:44:55.000Z | import torch.nn as nn
import torchvision
import copy
import torch
import numpy as np
from .bnneck import BNClassifier, Classifier, Classifier_without_bias
from torch.autograd import Variable
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
nn.init.kaiming... | 39.088123 | 97 | 0.596746 |
f74e0200adbfb470ed10ccb5f8fb109eef363145 | 2,430 | py | Python | posthog/test/test_team.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-04-09T09:13:23.000Z | 2021-04-09T09:13:23.000Z | posthog/test/test_team.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-10-13T10:05:26.000Z | 2021-10-13T10:05:26.000Z | posthog/test/test_team.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-09-16T18:18:07.000Z | 2021-09-16T18:18:07.000Z | import random
from unittest import mock
from django.conf import settings
from posthog.models import EventDefinition, Organization, PluginConfig, PropertyDefinition, Team, User
from posthog.plugins.test.mock import mocked_plugin_requests_get
from .base import BaseTest
class TestTeam(BaseTest):
def test_team_has... | 40.5 | 120 | 0.620165 |
f74e08e4c8d1d1fe496413d1edcd2c47c6720d19 | 1,230 | py | Python | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 9 | 2021-12-07T07:52:28.000Z | 2022-03-23T10:26:25.000Z | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 71 | 2021-12-03T09:40:56.000Z | 2022-03-29T21:47:38.000Z | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 3 | 2021-12-07T07:52:32.000Z | 2022-02-17T09:55:00.000Z | """ Module containing DocumentPublisher class """
from ..common.common import SectionHandler
# pylint: disable=too-few-public-methods
class DocumentPublisher(SectionHandler):
""" Responsible for converting the DocumentPublisher section:
- /cvrf:cvrfdoc/cvrf:DocumentPublisher
"""
type_category_mappi... | 36.176471 | 87 | 0.669919 |
f74e413462485792cfeac1ed30e015ec7d596664 | 2,273 | py | Python | arjuna-samples/arjex/test/pkg/webui_adv/check_webuiadv_09_element_waiters.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/webui_adv/check_webuiadv_09_element_waiters.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/webui_adv/check_webuiadv_09_element_waiters.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... | 33.925373 | 93 | 0.721953 |
f74e4287c01a51060cf687db264b8e8ef4e28055 | 3,974 | py | Python | src/bintools/run/utils.py | Simonll/bintools | 009c9616545f3fc51b897da9bc53f35fb23c99eb | [
"MIT"
] | null | null | null | src/bintools/run/utils.py | Simonll/bintools | 009c9616545f3fc51b897da9bc53f35fb23c99eb | [
"MIT"
] | null | null | null | src/bintools/run/utils.py | Simonll/bintools | 009c9616545f3fc51b897da9bc53f35fb23c99eb | [
"MIT"
] | null | null | null | import os
import shlex
import subprocess
import sys
from textwrap import dedent
from typing import Any
from typing import Optional
from typing import Tuple
def joint_kwargs(**kwargs) -> str:
return " ".join([k + " " + v for k, v in kwargs.items()])
def sub(
cmd: str, cwd: Optional[str] = None, stdout: bool ... | 30.806202 | 109 | 0.623805 |
f74eb6a1211b850dd0c08d41c1bfb52d80014d5e | 7,431 | py | Python | tests/mock/responses/get_artist_albums.py | steinitzu/spoffy | 40cce0f00accbe006084a610d0d50396c21ec96c | [
"Apache-2.0"
] | 1 | 2019-04-24T19:50:03.000Z | 2019-04-24T19:50:03.000Z | tests/mock/responses/get_artist_albums.py | steinitzu/spoffy | 40cce0f00accbe006084a610d0d50396c21ec96c | [
"Apache-2.0"
] | 3 | 2019-10-11T20:31:57.000Z | 2020-04-13T16:06:43.000Z | tests/mock/responses/get_artist_albums.py | steinitzu/spoffy | 40cce0f00accbe006084a610d0d50396c21ec96c | [
"Apache-2.0"
] | null | null | null | import json
_jalbums_relinked = """
{
"href": "https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?offset=0&limit=5&include_groups=album,single,compilation,appears_on&market=ES",
"items": [
{
"album_group": "album",
"album_type": "album",
"artists": [
{
"externa... | 31.35443 | 155 | 0.543534 |
f74f17b1cd8e2279c5414ec03d52994e78e9f11a | 7,521 | py | Python | src/gcg/tf/tf_utils.py | gkahn13/GtS | 8186177de430d4bfef253bb0ea584ee60dc58d3a | [
"MIT"
] | 74 | 2019-02-12T04:52:01.000Z | 2021-06-11T00:19:45.000Z | src/gcg/tf/tf_utils.py | gkahn13/GtS | 8186177de430d4bfef253bb0ea584ee60dc58d3a | [
"MIT"
] | 5 | 2019-02-27T13:38:56.000Z | 2020-11-30T11:29:28.000Z | src/gcg/tf/tf_utils.py | gkahn13/GtS | 8186177de430d4bfef253bb0ea584ee60dc58d3a | [
"MIT"
] | 16 | 2019-02-20T12:09:25.000Z | 2022-02-09T12:49:09.000Z | import os
import tensorflow as tf
######################
### Graph creation ###
######################
def create_session_and_graph(gpu_device=None, gpu_frac=None):
if gpu_device is None:
gpu_device = 0
if gpu_frac is None:
gpu_frac = 0.95
os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_devi... | 33.426667 | 97 | 0.622391 |
f74f3829da2705e46843cc6a81bb5eb4e6ca8f5d | 8,514 | py | Python | nova/virt/libvirt/storage/lvm.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/storage/lvm.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/storage/lvm.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2020-07-24T00:41:18.000Z | 2020-07-24T00:41:18.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2011 OpenStack Foundation
# (c) Cop... | 35.181818 | 79 | 0.576345 |
f74f442f8a8539ca9d7302fa625db30470e394c4 | 833 | py | Python | 1679. Max Number of K-Sum Pairs.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | 4 | 2020-11-17T05:24:24.000Z | 2021-06-14T21:01:45.000Z | 1679. Max Number of K-Sum Pairs.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | null | null | null | 1679. Max Number of K-Sum Pairs.py | Dharaneeshwar/Leetcode | cc3ed07f6ac5f4d6e3f60c57a94a06a8be2f5287 | [
"MIT"
] | null | null | null | # Space - O(1) ; Time - O(n logn)
class Solution:
def maxOperations(self, nums: List[int], k: int) -> int:
nums.sort()
i = 0
j = len(nums)-1
op = 0
while i<j:
val = nums[i] + nums[j]
if val == k:
op += 1
i += 1
... | 23.8 | 60 | 0.35054 |
f74f5822c0300aed1e291eb49337ea10c51fdf3e | 9,319 | py | Python | pytree/models/n_ary/modeling_n_ary.py | AntoineSimoulin/pytree | 9408799c4b8d4d59b1103e2205ffe7b250614f92 | [
"Apache-2.0"
] | 18 | 2021-11-10T13:34:02.000Z | 2021-12-17T13:28:00.000Z | pytree/models/n_ary/modeling_n_ary.py | AntoineSimoulin/pytree | 9408799c4b8d4d59b1103e2205ffe7b250614f92 | [
"Apache-2.0"
] | null | null | null | pytree/models/n_ary/modeling_n_ary.py | AntoineSimoulin/pytree | 9408799c4b8d4d59b1103e2205ffe7b250614f92 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import torch
from typing import List, Tuple, Optional, overload, Union, cast
from torch import Tensor
from transformers import BertModel
from pytree.data.packed_tree import PackedTree
class TreeEmbeddings(nn.Module):
def __init__(self, config):
super(TreeEmbeddings, self).__init__()... | 43.344186 | 163 | 0.593841 |
f74f5aefcc5817037ddcd5c4e1f68206420349a7 | 292 | py | Python | paper_spider/paper_spider/pipelines.py | peterwilliams97/ToneRanger | 61ab8b5a96bbf3f82b8e6a07e470831189afff8c | [
"MIT"
] | null | null | null | paper_spider/paper_spider/pipelines.py | peterwilliams97/ToneRanger | 61ab8b5a96bbf3f82b8e6a07e470831189afff8c | [
"MIT"
] | null | null | null | paper_spider/paper_spider/pipelines.py | peterwilliams97/ToneRanger | 61ab8b5a96bbf3f82b8e6a07e470831189afff8c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
class PaperSpiderPipeline(object):
def process_item(self, item, spider):
return item
| 24.333333 | 65 | 0.715753 |
f74f5df1c1719aeb789b373dcb8e714b822f3b7c | 699 | py | Python | runtests.py | apache/openwhisk-tutorial | f3d4e1ef8eb41462cff525df02dbbdd4998e471a | [
"Apache-2.0"
] | 2 | 2019-12-23T19:11:48.000Z | 2021-11-10T15:53:41.000Z | runtests.py | tspannhw/incubator-openwhisk-tutorial | f3d4e1ef8eb41462cff525df02dbbdd4998e471a | [
"Apache-2.0"
] | 5 | 2019-08-15T15:31:21.000Z | 2019-08-15T15:32:00.000Z | runtests.py | tspannhw/incubator-openwhisk-tutorial | f3d4e1ef8eb41462cff525df02dbbdd4998e471a | [
"Apache-2.0"
] | 2 | 2021-11-04T12:32:33.000Z | 2021-11-10T15:53:32.000Z | import sys
from django.conf import settings
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='whisk_tutorial.urls',
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.content... | 24.103448 | 63 | 0.65093 |
f74f8120e9b462eb6456b7cfccf5a20184b1bf35 | 16,367 | py | Python | sunpy/wcs/wcs.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | sunpy/wcs/wcs.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | sunpy/wcs/wcs.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import numpy as np
import sunpy.sun as sun
import astropy.units as u
rsun_meters = sun.constants.radius.si.value
__all__ = ['_convert_angle_units', 'convert_pixel_to_data', 'convert_hpc_hg',
'convert_data_to_pixel', 'convert_hpc_hcc', 'convert_hcc_hpc',
'... | 33.886128 | 117 | 0.637136 |
f74f9fdcdf2e4eef050033ba9110b8512ffecec0 | 13,880 | py | Python | django_xsede_warehouse/warehouse_views/views.py | XSEDE/XSEDE_Information_Warehouse | 8b3aab42b7afd70ce69b9bf44551a0ded4491831 | [
"Apache-2.0"
] | 1 | 2019-10-29T22:50:29.000Z | 2019-10-29T22:50:29.000Z | django_xsede_warehouse/warehouse_views/views.py | XSEDE/XSEDE_Information_Warehouse | 8b3aab42b7afd70ce69b9bf44551a0ded4491831 | [
"Apache-2.0"
] | null | null | null | django_xsede_warehouse/warehouse_views/views.py | XSEDE/XSEDE_Information_Warehouse | 8b3aab42b7afd70ce69b9bf44551a0ded4491831 | [
"Apache-2.0"
] | null | null | null | from django.db.models import Q
from django.core.serializers import serialize
from django.shortcuts import render
from django.template.loader import get_template
from django.utils.encoding import uri_to_iri
from django.urls import reverse, get_script_prefix
from rest_framework.views import APIView
from rest_framework.p... | 47.862069 | 176 | 0.666643 |
f74fa0f3a2763d5eaa33dddd189e55e34c5fb13b | 339 | py | Python | src/supervised_model.py | gdex1/irl-maxent | 86cfdaab6111cb65a866d384fbf811d812ee434d | [
"MIT"
] | null | null | null | src/supervised_model.py | gdex1/irl-maxent | 86cfdaab6111cb65a866d384fbf811d812ee434d | [
"MIT"
] | null | null | null | src/supervised_model.py | gdex1/irl-maxent | 86cfdaab6111cb65a866d384fbf811d812ee434d | [
"MIT"
] | null | null | null | class SupervisedModel:
def train(self, x, y):
raise NotImplementedError
def predict(self, x):
raise NotImplementedError
def predict_classes(self, x):
raise NotImplementedError
def save(self, path):
raise NotImplementedError
def load(self, path):
raise ... | 22.6 | 33 | 0.654867 |
f74fb5ebce9c57818173ac4fea01bd68112477e2 | 1,955 | py | Python | tests/check_tests.py | snare/idiot | 840a8e0de30724bca8298ae1318906d3f273f3d9 | [
"MIT"
] | 145 | 2016-03-16T10:37:06.000Z | 2021-08-02T16:51:01.000Z | tests/check_tests.py | snare/idiot | 840a8e0de30724bca8298ae1318906d3f273f3d9 | [
"MIT"
] | 5 | 2016-03-27T11:27:51.000Z | 2018-07-03T08:00:47.000Z | tests/check_tests.py | snare/idiot | 840a8e0de30724bca8298ae1318906d3f273f3d9 | [
"MIT"
] | 16 | 2016-03-17T06:08:38.000Z | 2020-12-18T18:21:08.000Z | import nose
import idiot
import datetime
import time
def setup():
idiot.init()
def teardown():
pass
def test_snooze_intervals():
p = idiot.CheckPlugin()
assert p.snooze_intervals == idiot.config.snooze_intervals
class TestPlugin(idiot.CheckPlugin):
snooze_intervals = [1, 2, 3, 4]
... | 26.418919 | 112 | 0.6711 |
f74fe68e2cf07bb416f98ce860a10fc269f21232 | 336 | py | Python | test/mitmproxy/test_master.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | test/mitmproxy/test_master.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | test/mitmproxy/test_master.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | import asyncio
from mitmproxy.test.taddons import RecordingMaster
async def err():
raise RuntimeError
async def test_exception_handler():
m = RecordingMaster(None)
running = asyncio.create_task(m.run())
asyncio.create_task(err())
await m.await_log("Traceback", level="error")
m.shutdown()
... | 19.764706 | 50 | 0.717262 |
f74ff99a051b6ceeea8d0cba5506b01714e04e98 | 1,329 | py | Python | website/addons/s3/settings/defaults.py | dplorimer/osf | 9f3f400f62dc7bde18532949ed35bf1d3f6ec3d6 | [
"Apache-2.0"
] | null | null | null | website/addons/s3/settings/defaults.py | dplorimer/osf | 9f3f400f62dc7bde18532949ed35bf1d3f6ec3d6 | [
"Apache-2.0"
] | 13 | 2020-03-24T15:29:41.000Z | 2022-03-11T23:15:28.000Z | website/addons/s3/settings/defaults.py | dplorimer/osf | 9f3f400f62dc7bde18532949ed35bf1d3f6ec3d6 | [
"Apache-2.0"
] | null | null | null | import json
import os
from website.settings import parent_dir
HERE = os.path.dirname(os.path.abspath(__file__))
STATIC_PATH = os.path.join(parent_dir(HERE), 'static')
MAX_RENDER_SIZE = (1024 ** 2) * 3
ALLOWED_ORIGIN = '*'
BUCKET_LOCATIONS = {}
ENCRYPT_UPLOADS_DEFAULT = True
# Load S3 settings used in both front a... | 25.075472 | 66 | 0.485327 |
f7500e80768f8c0750263afa5156f9e8cf6f48ec | 22,399 | py | Python | Source/ThirdParty/libwebrtc/Source/PRESUBMIT.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Source/ThirdParty/libwebrtc/Source/PRESUBMIT.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Source/ThirdParty/libwebrtc/Source/PRESUBMIT.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 39.296491 | 80 | 0.700344 |
f7501f9ba404e8efcee17bc15a9901ed269dcbb4 | 1,038 | py | Python | passpie/utils.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 700 | 2015-05-02T20:58:37.000Z | 2022-01-20T18:49:17.000Z | passpie/utils.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 108 | 2015-05-02T02:56:39.000Z | 2021-07-01T21:46:10.000Z | passpie/utils.py | bcfurtado/passpie | 421c40a57ad5f55e3f14b323c929a2c41dfb5527 | [
"MIT"
] | 72 | 2015-05-03T02:50:24.000Z | 2021-06-09T03:38:51.000Z | from contextlib import contextmanager
import errno
import os
import re
from random import SystemRandom
import tempfile
from rstr import Rstr
from ._compat import which
rstr = Rstr(SystemRandom())
import_module = __import__
def genpass(pattern=r'[\w]{32}'):
"""generates a password with random chararcters
... | 18.872727 | 73 | 0.644509 |
f75039b9ae96b9a954037d553ff74ae27cd78a36 | 2,055 | py | Python | beers/migrations/0023_auto_20190408_2248.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 18 | 2018-12-06T01:46:37.000Z | 2021-10-17T10:37:17.000Z | beers/migrations/0023_auto_20190408_2248.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 194 | 2018-11-04T12:50:49.000Z | 2022-01-06T22:43:43.000Z | beers/migrations/0023_auto_20190408_2248.py | danroberts728/hsvdotbeer | 5b977bf4a7aab149ad56564b3adbb09424500308 | [
"Apache-2.0"
] | 7 | 2019-03-18T05:36:06.000Z | 2020-12-25T03:27:29.000Z | # Generated by Django 2.2 on 2019-04-08 22:48
import django.contrib.postgres.fields.citext
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("beers", "0022_merge_common_endings"),
]
operations = [
migration... | 28.943662 | 83 | 0.400487 |
f7504ce3c2129d452007d4609794425ab78791e6 | 2,067 | py | Python | imagenet_training/models/simple_cnn.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/models/simple_cnn.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | imagenet_training/models/simple_cnn.py | daniilgaltsev/ImageNet-Training | 9ca1d26cde07782398c7f366d5bf510c9e988236 | [
"MIT"
] | null | null | null | """A simple cnn model."""
import argparse
from collections import OrderedDict
from typing import Any, Dict, Optional
import torch
import torch.nn as nn
class SimpleCNN(nn.Module):
"""A simple CNN model.
Args:
data_config: a dictionary containing information about data.
args (optional): arg... | 30.397059 | 79 | 0.56507 |
f7505d1b79d2a9cd8601e32e758458b01b198dd8 | 5,863 | py | Python | net_performance_comparison.py | SandhyaaGopchandani/PythonNetworkLibsComparion | 72db0cabecd0a9764663a044b19ef4dde843c402 | [
"MIT"
] | 1 | 2019-05-27T07:44:23.000Z | 2019-05-27T07:44:23.000Z | net_performance_comparison.py | SandhyaaGopchandani/PythonNetworkLibsComparion | 72db0cabecd0a9764663a044b19ef4dde843c402 | [
"MIT"
] | null | null | null | net_performance_comparison.py | SandhyaaGopchandani/PythonNetworkLibsComparion | 72db0cabecd0a9764663a044b19ef4dde843c402 | [
"MIT"
] | null | null | null | import itertools
import numpy as np
from timeit import default_timer as timer
from graph_tool.all import *
import pickle
import networkx as nx
import matplotlib as mpl
#mpl.use('TkAgg')
import matplotlib.pyplot as plt
from igraph import *
def nodes_edges(num_nodes):
""" this function takes number of nodes and ret... | 38.827815 | 127 | 0.640287 |
f7507aab80565d9a085aad59b3fafd181bc5706f | 207 | py | Python | attic/specialization.py | IMS-workshop/cython-numba | fc9560752f15908d616666df78b1beb970a00a55 | [
"BSD-3-Clause"
] | null | null | null | attic/specialization.py | IMS-workshop/cython-numba | fc9560752f15908d616666df78b1beb970a00a55 | [
"BSD-3-Clause"
] | null | null | null | attic/specialization.py | IMS-workshop/cython-numba | fc9560752f15908d616666df78b1beb970a00a55 | [
"BSD-3-Clause"
] | null | null | null | from numba import jit, int32
@jit(int32(int32, int32))
def f(x, y):
# A somewhat trivial example
return x + y
print(f)
# print(f(123, 123**30))
@jit(nopython=True)
def f(x, y):
return x + y
| 12.9375 | 32 | 0.613527 |
f750c7c66b6901abf81b3820cf58e07e28870047 | 5,197 | py | Python | oscar/lib/python2.7/site-packages/setuptools/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/setuptools/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/setuptools/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Extensions to the 'distutils' for large or complex distributions"""
import os
import functools
import distutils.core
import distutils.filelist
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools.extern.six.moves import filter, map
import setuptools.version
from setu... | 32.279503 | 80 | 0.630941 |
f750d0003606d9d7cd8b3218994de8998bf613fd | 3,108 | py | Python | xml_py/routedem.py | mlacayoemery/wps-server-invest | c3d5eca357218dac76225028fab491b357cbc343 | [
"MIT"
] | null | null | null | xml_py/routedem.py | mlacayoemery/wps-server-invest | c3d5eca357218dac76225028fab491b357cbc343 | [
"MIT"
] | null | null | null | xml_py/routedem.py | mlacayoemery/wps-server-invest | c3d5eca357218dac76225028fab491b357cbc343 | [
"MIT"
] | null | null | null | import pywps
import pywps.validator.mode
import natcap.invest.routing.routedem
import tempfile
import os.path
import logging
import sys
class invest(pywps.Process):
def __init__(self):
inputs = [pywps.LiteralInput("calculate_downstream_distance",
"Calculate Downstream... | 43.774648 | 102 | 0.535071 |
f750d25a6569ab0b4f3ca88347c14468fa6858b4 | 7,567 | py | Python | cm/app/api_v1/my_calculation_module_directory/CM/__delete_if_tested__/CEDM/create_csv_results.py | HotMaps/renovation_effect | 469a01b4cc805256768d884a3a2ae4560770b734 | [
"Apache-2.0"
] | 1 | 2021-05-11T06:41:04.000Z | 2021-05-11T06:41:04.000Z | cm/app/api_v1/my_calculation_module_directory/CM/__delete_if_tested__/CEDM/create_csv_results.py | mayr-ethink/renovation_effect | 5b1fb81102b3c6ee531b719d8136ed9a343c2598 | [
"Apache-2.0"
] | 2 | 2020-06-04T20:19:36.000Z | 2020-06-04T20:19:36.000Z | cm/app/api_v1/my_calculation_module_directory/CM/__delete_if_tested__/CEDM/create_csv_results.py | mayr-ethink/renovation_effect | 5b1fb81102b3c6ee531b719d8136ed9a343c2598 | [
"Apache-2.0"
] | null | null | null |
import numpy as np
import os
import time
import sys
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.
abspath(__file__))))
if path not in sys.path:
sys.path.append(path)
import CM_intern.CEDM.modules.cyf.create_density_map as CDM
import CM_... | 38.805128 | 141 | 0.584776 |
f750d6ad1e45999c9e0206221e729359e5243f54 | 1,434 | py | Python | metrics.py | bhigy/discrete-repr | 3d4a4fc3833df3a1fa287c78c7402ce6df09abd4 | [
"Apache-2.0"
] | 1 | 2021-09-24T03:44:13.000Z | 2021-09-24T03:44:13.000Z | metrics.py | bhigy/discrete-repr | 3d4a4fc3833df3a1fa287c78c7402ce6df09abd4 | [
"Apache-2.0"
] | null | null | null | metrics.py | bhigy/discrete-repr | 3d4a4fc3833df3a1fa287c78c7402ce6df09abd4 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
from itertools import groupby
from math import log2
import numpy as np
def segments_start(array):
return [i for i in range(len(array)) if i == 0 or array[i] != array[i-1]]
def split_sequences(array, start):
end = start[1:] + [len(array)]
return [array[s:e] for s, e in zip... | 28.68 | 77 | 0.642957 |
f750d86c9cddcc067645619ba4b167eff700690a | 1,490 | py | Python | oscar/lib/python2.7/site-packages/django/conf/locale/el/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/el/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/el/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 = 'd/m/Y'
TIME_FORMAT = 'P'
... | 38.205128 | 83 | 0.547651 |
f750e30c4991c96cda7995ac565e9bcfe9a00927 | 6,390 | py | Python | JumpScale9AYS/jobcontroller/Run.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 4 | 2017-06-07T08:10:06.000Z | 2017-11-10T02:20:38.000Z | JumpScale9AYS/jobcontroller/Run.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 242 | 2017-05-18T10:51:48.000Z | 2019-09-18T15:09:47.000Z | JumpScale9AYS/jobcontroller/Run.py | Jumpscale/ays9 | 63bd414ff06372ba885c55eec528f427e63bcbe1 | [
"Apache-2.0"
] | 5 | 2017-06-16T15:43:25.000Z | 2017-09-29T12:48:06.000Z | import colored_traceback
from .RunStep import RunStep
from js9 import j
import json
import aiohttp
colored_traceback.add_hook(always=True)
RETRY_DELAY = [10, 30, 60, 300, 600, 1800] # time of each retry in seconds, total: 46min 10sec
class Run:
def __init__(self, model):
self.lastnr = 0
self.log... | 31.323529 | 125 | 0.54507 |
f751009df47057bacc6d0fbf6d1ab04c87998a96 | 3,617 | py | Python | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 3 | 2019-01-20T19:37:25.000Z | 2019-01-29T10:21:48.000Z | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-02-13T06:42:26.000Z | 2019-03-11T14:04:43.000Z | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-02-13T05:44:16.000Z | 2019-02-13T05:44:16.000Z | import logging
import os
import platform
import re
import subprocess
from pathlib import Path
logger = logging.getLogger(__name__)
BASEDIR = {
"Windows": "C:/Program Files (x86)/StarCraft II",
"Darwin": "/Applications/StarCraft II",
"Linux": "~/StarCraftII",
"WineLinux": "~/.wine/drive_c/Program Files... | 31.72807 | 118 | 0.570086 |
f7510917c531028cdc2a3b2f96098d6833ccdc4d | 2,269 | py | Python | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 6 | 2018-11-07T12:41:30.000Z | 2020-04-12T18:07:03.000Z | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 1 | 2020-10-20T12:33:18.000Z | 2020-10-20T12:33:18.000Z | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 10 | 2018-11-12T06:15:19.000Z | 2021-11-18T05:45:12.000Z | """
DRS Package for API unit tests
Copyright (c) 2018-2020 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
Redistribu... | 126.055556 | 844 | 0.806523 |
f7510e2e57e70b9bdc54e35893fb2f16f92ff9d7 | 1,917 | py | Python | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | # Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
import os
import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import walk_dir
pyt... | 32.491525 | 98 | 0.651539 |
f7513761a06800074ca2316b36ca1967570f5c68 | 876 | py | Python | Tools/ROS/entity_storage/scripts/test.py | ToyotaResearchInstitute/rad-robot | 9a47e4d88382719ab9bf142932fbcc83dcbcd665 | [
"MIT"
] | null | null | null | Tools/ROS/entity_storage/scripts/test.py | ToyotaResearchInstitute/rad-robot | 9a47e4d88382719ab9bf142932fbcc83dcbcd665 | [
"MIT"
] | null | null | null | Tools/ROS/entity_storage/scripts/test.py | ToyotaResearchInstitute/rad-robot | 9a47e4d88382719ab9bf142932fbcc83dcbcd665 | [
"MIT"
] | 2 | 2018-06-04T12:38:54.000Z | 2018-09-22T10:31:27.000Z | #!/usr/bin/env python
import roslib; roslib.load_manifest('entity_storage')
from entity_storage.srv import *
from entity_storage.msg import *
import rospy
def get_coordinates(name):
rospy.wait_for_service('get_entity_coordinates')
try:
get_coords = rospy.ServiceProxy('get_entity_coordinates', entity_c... | 31.285714 | 98 | 0.68379 |
f7514c3a3eaf678ce7d778ca6c7f72f18d562af5 | 3,134 | py | Python | chapter12/djangoApplication/djangoApplication/settings.py | yangwawa0323/Learning-Python-Networking-Second-Edition | 5460fe4fb6acc5d0df19bf36e52ac09e9a11eb8b | [
"MIT"
] | 52 | 2018-12-17T19:33:06.000Z | 2022-03-25T18:14:02.000Z | chapter12/djangoApplication/djangoApplication/settings.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | null | null | null | chapter12/djangoApplication/djangoApplication/settings.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | 38 | 2018-12-18T09:08:43.000Z | 2022-02-06T02:53:05.000Z | """
Django settings for djangoApplication project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
im... | 25.688525 | 91 | 0.700064 |
f751527f4010db2178948021484f40185235157b | 15,959 | py | Python | egg/zoo/basic_games/play.py | schlevik/EGG | 428d5aed3eb6fb0296f6856fb77b0a1cdceb33f1 | [
"MIT"
] | null | null | null | egg/zoo/basic_games/play.py | schlevik/EGG | 428d5aed3eb6fb0296f6856fb77b0a1cdceb33f1 | [
"MIT"
] | null | null | null | egg/zoo/basic_games/play.py | schlevik/EGG | 428d5aed3eb6fb0296f6856fb77b0a1cdceb33f1 | [
"MIT"
] | 1 | 2021-09-14T12:19:41.000Z | 2021-09-14T12:19:41.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 argparse
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
import egg.core as co... | 48.655488 | 236 | 0.672348 |
f75154c0f96287fe4623112f3de0cc0e61d931f4 | 4,357 | py | Python | experiments/murtaza/multiworld/camera_ready/pusher/offline_vae2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/camera_ready/pusher/offline_vae2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/camera_ready/pusher/offline_vae2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import rlkit.misc.hyperparameter as hyp
from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright_v3
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.grill.launcher import grill_her_td3_full_experiment
if __name__ == "__main__":
variant = dict(
imsize=84,
init... | 35.713115 | 151 | 0.54992 |
f7515b5996d204f1739b35001a682bbd11b2cc6a | 940 | py | Python | src/ipcollector/setup.py | logdna/k8s-egress-networkpolicy-manager | 3305ed30cbd07d1b549b743d02fde53a596780ca | [
"MIT"
] | null | null | null | src/ipcollector/setup.py | logdna/k8s-egress-networkpolicy-manager | 3305ed30cbd07d1b549b743d02fde53a596780ca | [
"MIT"
] | null | null | null | src/ipcollector/setup.py | logdna/k8s-egress-networkpolicy-manager | 3305ed30cbd07d1b549b743d02fde53a596780ca | [
"MIT"
] | 1 | 2021-09-26T00:06:52.000Z | 2021-09-26T00:06:52.000Z | from ipcollector import __version__
from setuptools import setup, find_packages
from sys import path
from os import environ
path.insert(0, '.')
NAME = 'ipcollector'
if __name__ == '__main__':
with open(environ.get('REQUIREMENTS_TXT', 'requirements.txt')) as f:
requirements = f.read().splitlines()
s... | 29.375 | 162 | 0.669149 |
f75166e1db0088a12e37baa7c00ade5398b544c7 | 1,071 | py | Python | merge_geo_with collocates.py | RSLancs/Extracting_plant_names_and_collocates_from_historical_texts | c8d6746978786ca4b83dc550114700530077c543 | [
"Apache-2.0"
] | null | null | null | merge_geo_with collocates.py | RSLancs/Extracting_plant_names_and_collocates_from_historical_texts | c8d6746978786ca4b83dc550114700530077c543 | [
"Apache-2.0"
] | null | null | null | merge_geo_with collocates.py | RSLancs/Extracting_plant_names_and_collocates_from_historical_texts | c8d6746978786ca4b83dc550114700530077c543 | [
"Apache-2.0"
] | null | null | null | ##python27
from pprint import pprint
import pandas as pd
##..............open manually merged geoparsed results
geo = pd.read_csv('./data/merger_xml_extracted_geoparsed_collocates.csv')
geo = [tuple(x) for x in geo.values] # df to list
print(geo[1])
##..........open collocate results....
collocate = p... | 26.121951 | 96 | 0.606909 |
f7516d72cf57a5045a31b1bc07961010f578dc55 | 5,009 | py | Python | q2_longitudinal/_vega_specs/volatility/data.py | sterrettJD/q2-longitudinal | d9edd427c9668c8b95d708fc3c4d2722204c9ce0 | [
"BSD-3-Clause"
] | 10 | 2017-09-13T03:16:34.000Z | 2022-01-31T06:07:00.000Z | q2_longitudinal/_vega_specs/volatility/data.py | sterrettJD/q2-longitudinal | d9edd427c9668c8b95d708fc3c4d2722204c9ce0 | [
"BSD-3-Clause"
] | 114 | 2017-08-10T00:19:09.000Z | 2022-03-03T06:48:07.000Z | q2_longitudinal/_vega_specs/volatility/data.py | sterrettJD/q2-longitudinal | d9edd427c9668c8b95d708fc3c4d2722204c9ce0 | [
"BSD-3-Clause"
] | 16 | 2017-08-23T21:33:57.000Z | 2022-01-28T16:26:44.000Z | # ----------------------------------------------------------------------------
# Copyright (c) 2017-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 46.813084 | 79 | 0.508884 |
f75176940202e76f8338ed5fd86bc72ce1de620e | 28,826 | py | Python | retrobiocat_web/retro/rdchiral/main.py | ihayhurst/RetroBioCat | d674897459c0ab65faad5ed3017c55cf51bcc020 | [
"MIT"
] | 9 | 2020-12-01T16:33:02.000Z | 2022-01-19T20:02:42.000Z | retrobiocat_web/retro/rdchiral/main.py | ihayhurst/RetroBioCat | d674897459c0ab65faad5ed3017c55cf51bcc020 | [
"MIT"
] | 4 | 2020-10-02T14:38:32.000Z | 2021-08-02T09:23:58.000Z | retrobiocat_web/retro/rdchiral/main.py | ihayhurst/RetroBioCat | d674897459c0ab65faad5ed3017c55cf51bcc020 | [
"MIT"
] | 6 | 2021-01-14T07:48:36.000Z | 2022-03-20T17:34:27.000Z | from __future__ import print_function
import sys
import os
import re
import copy
import rdkit.Chem as Chem
import rdkit.Chem.AllChem as AllChem
from rdkit.Chem.rdchem import ChiralType, BondType, BondDir
from retrobiocat_web.retro.rdchiral.utils import vprint, PLEVEL, atoms_are_different
from retrobiocat_web.retro.r... | 52.410909 | 144 | 0.575869 |
f7517ebb49513bbccd04a3711951b9223ce8a1b7 | 30,787 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_recognize_pii_entities.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import pytest
import platform
import functools
import json
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.crede... | 41.324832 | 152 | 0.64563 |
f7519752096720b558cc48482e85bc955853e1bc | 6,340 | py | Python | planet/splice.py | xaviershay/reader | 7c713c90ff546032e4723a232a32107ebae88278 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2016-05-09T10:18:18.000Z | 2016-05-09T10:18:18.000Z | planet/splice.py | xaviershay/reader | 7c713c90ff546032e4723a232a32107ebae88278 | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2015-09-04T06:26:22.000Z | 2021-09-04T12:33:32.000Z | planet/splice.py | xaviershay/reader | 7c713c90ff546032e4723a232a32107ebae88278 | [
"CNRI-Python-GPL-Compatible"
] | 3 | 2015-09-04T05:44:12.000Z | 2018-05-11T13:06:03.000Z | """ Splice together a planet from a cache of feed entries """
import glob, os, time, shutil
from xml.dom import minidom
import planet, config, feedparser, reconstitute, shell
from reconstitute import createTextElement, date
from spider import filename
from planet import idindex
def splice():
""" Splice together a ... | 37.738095 | 79 | 0.586751 |
f751af146af895c2b7971239633f9ed60b77862a | 2,076 | py | Python | mtr/sync/forms.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | mtr/sync/forms.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | mtr/sync/forms.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | from django import forms
from mtr.utils.forms import GlobalInitialFormMixin
from mtr.utils.helpers import model_choices
from .lib.manager import manager
from .models import Settings, Field
# TODO: refactor
class SettingsAdminForm(GlobalInitialFormMixin, forms.ModelForm):
class Meta:
exclude = tuple()... | 33.483871 | 71 | 0.631985 |
f751b95552a0b9a87022c05e2d6c1c8d426941f8 | 1,950 | py | Python | tests/test_redis.py | azhai/rdcache | 8f3ca558a2a9af11321916bfe548aaeb66ef75ae | [
"MIT"
] | null | null | null | tests/test_redis.py | azhai/rdcache | 8f3ca558a2a9af11321916bfe548aaeb66ef75ae | [
"MIT"
] | null | null | null | tests/test_redis.py | azhai/rdcache | 8f3ca558a2a9af11321916bfe548aaeb66ef75ae | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from datetime import date
from rdcache.ext import RedisCache, RedisPool
redis = RedisPool({
"default": {
"host": "127.0.0.1",
"port": 6379,
"password": "",
"db": 0,
},
})
backend = redis.get('default')
cache = RedisCache(backend, touch = ... | 27.464789 | 81 | 0.586667 |
f751c1a7b8557d111ece974fe0337ad5501315ca | 34 | py | Python | test/__init__.py | JugalBoro/trip-based-routing- | 66fd2095d6c072d16fe8d5a7ef0912ee72b22c08 | [
"WTFPL"
] | 43 | 2016-10-10T18:31:35.000Z | 2022-03-14T06:25:28.000Z | test/__init__.py | JugalBoro/trip-based-routing- | 66fd2095d6c072d16fe8d5a7ef0912ee72b22c08 | [
"WTFPL"
] | null | null | null | test/__init__.py | JugalBoro/trip-based-routing- | 66fd2095d6c072d16fe8d5a7ef0912ee72b22c08 | [
"WTFPL"
] | 8 | 2017-09-27T10:55:27.000Z | 2020-08-09T04:14:00.000Z | from . import _common
c = _common
| 11.333333 | 21 | 0.735294 |
f751f549655353ec5d37344c1567c2eb88340d0c | 28,933 | py | Python | src/transformersX/models/promptbert/modeling_promptbert.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | 2 | 2021-08-06T05:43:55.000Z | 2022-03-17T22:31:21.000Z | src/transformersX/models/promptbert/modeling_promptbert.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | src/transformersX/models/promptbert/modeling_promptbert.py | stevezheng23/fewshot_nlp_pt | aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 43.904401 | 213 | 0.666263 |
f75206c35d2b5070eaa00f5e8d63d5d6aeb16b70 | 2,370 | py | Python | alipay/aop/api/domain/AlipayPayAppCarPayModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayPayAppCarPayModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayPayAppCarPayModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayPayAppCarPayModel(object):
def __init__(self):
self._out_trade_no = None
self._qr_code = None
self._subject = None
self._total_amount = None
@property
... | 27.55814 | 75 | 0.583966 |
f7522b58fe759ad02beb5ce374a125dcdde42486 | 2,841 | py | Python | sphinx/conf.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | 3 | 2022-03-20T19:23:27.000Z | 2022-03-25T06:55:28.000Z | sphinx/conf.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | null | null | null | sphinx/conf.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder
import os
import sys
import inspect
import importlib
sys.path.insert(0, os.path.abspath('..'))
## Project
package = 'lampe'
project = 'LAMPE'
copyright = '2021-2022, François Rozet'
repository = 'https://github.com/francois-rozet/lampe'
## Extensions
exten... | 24.491379 | 80 | 0.636748 |
f7523d0a6e50bef72051d9b4e2c27753b138a21c | 11,353 | py | Python | openpype/hosts/nuke/plugins/load/load_mov.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | 1 | 2020-09-21T14:55:33.000Z | 2020-09-21T14:55:33.000Z | openpype/hosts/nuke/plugins/load/load_mov.py | jrsndl/pype | f9d80ef2c0663921291c5f47d24bea51fc43bac7 | [
"MIT"
] | null | null | null | openpype/hosts/nuke/plugins/load/load_mov.py | jrsndl/pype | f9d80ef2c0663921291c5f47d24bea51fc43bac7 | [
"MIT"
] | null | null | null | import nuke
from avalon.vendor import qargparse
from avalon import api, io
from openpype.api import get_current_project_settings
from openpype.hosts.nuke.api.lib import (
get_imageio_input_colorspace
)
def add_review_presets_config():
returning = {
"families": list(),
"representations": list()... | 32.623563 | 78 | 0.554039 |
f7529c1cda7df6a10d75d62cad3b470910c470bf | 5,849 | py | Python | tractseg/models/UNet_Pytorch_DeepSup.py | magreiner/TractSeg | 5ac5278fc3a6d3262f9f06924dbdde01b399ccf6 | [
"Apache-2.0"
] | null | null | null | tractseg/models/UNet_Pytorch_DeepSup.py | magreiner/TractSeg | 5ac5278fc3a6d3262f9f06924dbdde01b399ccf6 | [
"Apache-2.0"
] | null | null | null | tractseg/models/UNet_Pytorch_DeepSup.py | magreiner/TractSeg | 5ac5278fc3a6d3262f9f06924dbdde01b399ccf6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
#
# 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
#... | 40.061644 | 167 | 0.675158 |
f752b59568a74f56c9b581651e54d1cab2af227f | 341 | bzl | Python | tensorflow/core/kernels/fuzzing/tf_ops_fuzz_target_lib.bzl | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 850 | 2018-01-18T05:56:02.000Z | 2022-03-31T08:17:34.000Z | tensorflow/core/kernels/fuzzing/tf_ops_fuzz_target_lib.bzl | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/core/kernels/fuzzing/tf_ops_fuzz_target_lib.bzl | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 364 | 2018-01-22T02:11:16.000Z | 2022-03-27T12:58:47.000Z | """Fuzzing template for TensorFlow ops."""
def tf_ops_fuzz_target_lib(name):
native.cc_library(
name = name + "_fuzz_lib",
srcs = [name + "_fuzz.cc"],
deps = [
"//tensorflow/core/kernels/fuzzing:fuzz_session",
"//tensorflow/cc:cc_ops",
],
tags = ["no_windows"],
... | 24.357143 | 59 | 0.571848 |
f752b8c8b4ee879789503b541ffbf114963d79ab | 42 | py | Python | src/server/blueprints/exposable/__init__.py | sudo-at-night/palmox | 90651be4349ae09c3c1fc77b42eb75901fb10d81 | [
"MIT"
] | 1 | 2021-05-18T07:32:37.000Z | 2021-05-18T07:32:37.000Z | src/server/blueprints/exposable/__init__.py | sudo-at-night/palmox | 90651be4349ae09c3c1fc77b42eb75901fb10d81 | [
"MIT"
] | null | null | null | src/server/blueprints/exposable/__init__.py | sudo-at-night/palmox | 90651be4349ae09c3c1fc77b42eb75901fb10d81 | [
"MIT"
] | null | null | null | from .blueprint import exposable_blueprint | 42 | 42 | 0.904762 |
f752bdd1f32ccef9d81aa782593770a301b84a0f | 672 | py | Python | setup.py | xyproto/fnu | 47e41824ab7ce7746637036d60cf37ac9f381a61 | [
"MIT"
] | 3 | 2020-03-11T21:18:55.000Z | 2020-10-05T12:42:30.000Z | setup.py | xyproto/minitree | 47e41824ab7ce7746637036d60cf37ac9f381a61 | [
"MIT"
] | null | null | null | setup.py | xyproto/minitree | 47e41824ab7ce7746637036d60cf37ac9f381a61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
setup(name="minitree",
version="0.4.1",
description="List files in columns",
url="https://github.com/xyproto/minitree",
author="Alexander F. Rødseth",
author_email="xyproto@archlinux.org",
license="MIT",
... | 24 | 51 | 0.541667 |
f752e3223f28a9a09268748c9d23b25198db40b7 | 3,263 | py | Python | prepare_data.py | violetcodes/hiking-ridge | b10550f32172a0e36371e1ad84563be32e67ab4a | [
"Apache-2.0"
] | null | null | null | prepare_data.py | violetcodes/hiking-ridge | b10550f32172a0e36371e1ad84563be32e67ab4a | [
"Apache-2.0"
] | null | null | null | prepare_data.py | violetcodes/hiking-ridge | b10550f32172a0e36371e1ad84563be32e67ab4a | [
"Apache-2.0"
] | null | null | null | import utils
from tqdm import tqdm
jfile_texts = lambda jload: [i['section_title'] + ': ' + i['text'] for i in jload]
def find_index(text, target, width=100, find_only=False, lowr=True):
if lowr:
text = utils.clean_text(text)
target = utils.clean_text(target)
if find_only:
return t... | 32.306931 | 82 | 0.517315 |
f752e9468e334d361da0a8c8c316b96fa818e09f | 688 | py | Python | azure-devops/azext_devops/vstsCompressed/file_container/v4_1/models/__init__.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | azure-devops/azext_devops/vstsCompressed/file_container/v4_1/models/__init__.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | 37 | 2020-04-27T07:45:19.000Z | 2021-04-05T07:27:15.000Z | azure-devops/azext_devops/vstsCompressed/file_container/v4_1/models/__init__.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43 | 94 | 0.452035 |
f75316db187264acd547e92b9a375c0bf8205fd7 | 2,745 | py | Python | angalabiri/suggestion/views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 1 | 2021-03-25T14:06:23.000Z | 2021-03-25T14:06:23.000Z | angalabiri/suggestion/views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 5 | 2021-09-08T03:08:46.000Z | 2022-03-12T00:56:35.000Z | angalabiri/suggestion/views.py | me-edavids/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | null | null | null | from django.db.models import Sum, F
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.urls i... | 34.3125 | 91 | 0.738434 |
f753235d42eb26c88d363fa1ccf74fbd3ae519b9 | 501 | py | Python | nlp_annotator_api/server/signals/process_pool.py | dasaku-ai/nlpmodel-v-h | 326bb9467df11d517285610c70f9d22627eb5efc | [
"Apache-2.0"
] | 3 | 2022-01-04T12:15:22.000Z | 2022-03-25T21:19:20.000Z | nlp_annotator_api/server/signals/process_pool.py | IBM/deepsearch-nlp-annotator-api-example | 76c2c8fd83c1e6d51c51c7b581a8c3f273b23c40 | [
"Apache-2.0"
] | 1 | 2022-02-02T09:26:44.000Z | 2022-02-02T09:26:44.000Z | nlp_annotator_api/server/signals/process_pool.py | dasaku-ai/nlpmodel-v-h | 326bb9467df11d517285610c70f9d22627eb5efc | [
"Apache-2.0"
] | 5 | 2021-09-27T08:26:09.000Z | 2022-03-10T11:41:35.000Z | import logging
from concurrent.futures.process import ProcessPoolExecutor
logger = logging.getLogger(__name__)
def process_pool_factory(num_workers: int):
async def process_pool(app_instance):
logger.debug("Setting up process pool with %r workers", num_workers)
pool = ProcessPoolExecutor(max_wo... | 21.782609 | 76 | 0.720559 |
f753245c6149b5b259cd11b8a8f9fa6891a02d8c | 6,261 | py | Python | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | null | null | null | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2017-07-31T08:15:26.000Z | 2017-07-31T08:15:26.000Z | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2019-10-06T16:52:31.000Z | 2019-10-06T16:52:31.000Z | """This module implements the built-in data types of the Scheme language, along
with a parser for Scheme expressions.
In addition to the types defined in this file, some data types in Scheme are
represented by their corresponding type in Python:
number: int or float
symbol: string
boolean: ... | 29.257009 | 79 | 0.576585 |
f7532aa4aa3ade9a6ba2aa21ce694ce0cbe330ea | 4,540 | py | Python | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 385 | 2015-11-20T02:21:18.000Z | 2022-03-24T09:38:24.000Z | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 127 | 2016-07-08T20:23:20.000Z | 2022-02-23T13:52:19.000Z | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 68 | 2015-11-20T12:51:44.000Z | 2022-01-25T04:35:54.000Z | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | 37.213115 | 112 | 0.529075 |
f75358fc6aabeb256f1896a60b41ccf503b178b8 | 9,521 | py | Python | thatkitebot/cogs/laser.py | blablabliam/thatkitebot | 741e59993f05eb437b46d4839db517af7b8f0357 | [
"MIT"
] | null | null | null | thatkitebot/cogs/laser.py | blablabliam/thatkitebot | 741e59993f05eb437b46d4839db517af7b8f0357 | [
"MIT"
] | null | null | null | thatkitebot/cogs/laser.py | blablabliam/thatkitebot | 741e59993f05eb437b46d4839db517af7b8f0357 | [
"MIT"
] | null | null | null | # Copyright (c) 2019-2022 ThatRedKite and contributors
from typing import Optional
from discord.ext import commands
from wand.image import Image as WandImage
from wand.color import Color as WandColor
import discord
import si_prefix
from math import sin, atan
from io import BytesIO
from thatkitebot.backend import uti... | 45.555024 | 174 | 0.573469 |
f75369582837b000711508efcde4a79ae6b1963d | 12,244 | py | Python | tests/components/test_influxdb.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | tests/components/test_influxdb.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | tests/components/test_influxdb.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """The tests for the InfluxDB component."""
import unittest
from unittest import mock
import influxdb as influx_client
from homeassistant.bootstrap import setup_component
import homeassistant.components.influxdb as influxdb
from homeassistant.const import EVENT_STATE_CHANGED, STATE_OFF, STATE_ON
from tests.common im... | 35.387283 | 79 | 0.501225 |
f75385538ed3357b98f19d7d208efa4e98e8bebc | 34,012 | py | Python | brainbox/plot.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 38 | 2018-08-07T21:55:29.000Z | 2022-03-21T14:49:03.000Z | brainbox/plot.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 207 | 2018-07-25T15:10:48.000Z | 2022-03-08T13:23:08.000Z | brainbox/plot.py | int-brain-lab/ibllib | 93be6b98848758e05cdc9398caaf19e6a68f7386 | [
"MIT"
] | 35 | 2018-09-04T14:49:56.000Z | 2022-01-06T21:17:51.000Z | """
Plots metrics that assess quality of single units. Some functions here generate plots for the
output of functions in the brainbox `single_units.py` module.
Run the following to set-up the workspace to run the docstring examples:
>>> from brainbox import processing
>>> import alf.io as aio
>>> import numpy as np
>>... | 41.176755 | 99 | 0.635599 |
f753a5080fc68a40a6ef32fd98ddc29a3a9f83b6 | 2,339 | py | Python | src/using_multiprocessing.py | ariannasg/optimizing-python | e6c307dc694bc98c776faea1dbd7f420c2928f64 | [
"MIT"
] | null | null | null | src/using_multiprocessing.py | ariannasg/optimizing-python | e6c307dc694bc98c776faea1dbd7f420c2928f64 | [
"MIT"
] | null | null | null | src/using_multiprocessing.py | ariannasg/optimizing-python | e6c307dc694bc98c776faea1dbd7f420c2928f64 | [
"MIT"
] | null | null | null | #!usr/bin/env python3
import bz2
from concurrent.futures import ProcessPoolExecutor
def unpack(requests):
"""Unpack a list of requests compressed in bz2"""
return [bz2.decompress(request) for request in requests]
def unpack_proc(requests):
"""Unpack a list of requests compressed in bz2 using a process p... | 37.725806 | 103 | 0.637452 |
f753c0699ca176986a73a60b3e467af2e45d2c75 | 34,012 | py | Python | gdata/apps/emailsettings/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | gdata/apps/emailsettings/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | gdata/apps/emailsettings/data.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2010 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 ... | 30.072502 | 84 | 0.703193 |
f753cc0757c9c46acd73bd5eb278b702035d8dd5 | 5,842 | py | Python | test/test_sliprules.py | lynnmunday/neml | 2c0e3db9f849345dba01d64fc8488e2b97e477dd | [
"MIT"
] | null | null | null | test/test_sliprules.py | lynnmunday/neml | 2c0e3db9f849345dba01d64fc8488e2b97e477dd | [
"MIT"
] | null | null | null | test/test_sliprules.py | lynnmunday/neml | 2c0e3db9f849345dba01d64fc8488e2b97e477dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from neml import history, interpolate
from neml.math import tensors, rotations
from neml.cp import crystallography, slipharden, sliprules
from common import differentiate
from nicediff import *
import unittest
import numpy as np
import numpy.linalg as la
class CommonSlipRule(object):
def te... | 35.621951 | 109 | 0.657823 |
f753d4a3851fb7cad5ea563490d94024d0061b05 | 80,496 | py | Python | Kernel.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | Kernel.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | Kernel.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | import time
from threading import Thread, Lock
from LaserOperation import *
from svgelements import Path, SVGText
STATE_UNKNOWN = -1
STATE_INITIALIZE = 0
STATE_IDLE = 1
STATE_ACTIVE = 2
STATE_BUSY = 3
STATE_PAUSE = 4
STATE_END = 5
STATE_TERMINATE = 10
INTERPRETER_STATE_RAPID = 0
INTERPRETER_STATE_FIN... | 37.146285 | 126 | 0.555667 |
f753dffc2fb865ec5ac4199a5e21df845c7e2b12 | 1,244 | py | Python | 00_LIBRARIES/00_NUMPY/03_numpy_manipulations.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | 2 | 2021-03-18T06:07:09.000Z | 2021-05-08T22:14:14.000Z | 00_LIBRARIES/00_NUMPY/03_numpy_manipulations.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | null | null | null | 00_LIBRARIES/00_NUMPY/03_numpy_manipulations.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | null | null | null | # NUMPY MANIPULATIONS OF ARRAYS
# Santiago Garcia Arango
# -------------------------------------------------------------------------
import numpy as np
my_array = np.arange(1, 11) # [1,2,..,8,9,10]
print("my_array=\n", my_array, "\n")
# -----------------CHECKING CONDITIONS IN ARRAY ITEMS----------------------
# FIR... | 32.736842 | 75 | 0.596463 |
f754708b2250b03d251cc3778718e2d65bd43090 | 661 | py | Python | design_patterns/oop/alien_game/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | design_patterns/oop/alien_game/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | design_patterns/oop/alien_game/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | from abc import ABCMeta, abstractmethod
class Scene(object):
__metaclass__ = ABCMeta
@abstractmethod
def enter(self):
"""
Enter method to every scene
:return:
"""
pass
class Engine(object):
__metaclass__ = ABCMeta
def __init__(self, scene_map):
s... | 16.525 | 39 | 0.620272 |
f7547ea80bb2de55ad47fa7ca92198ad1630f16d | 845 | py | Python | models/languageManager.py | falconsmilie/Raspberry-Pi-3-Weather | 132ed29d7d717e1597d1c5e8dcb5fcf716c81d17 | [
"MIT"
] | null | null | null | models/languageManager.py | falconsmilie/Raspberry-Pi-3-Weather | 132ed29d7d717e1597d1c5e8dcb5fcf716c81d17 | [
"MIT"
] | null | null | null | models/languageManager.py | falconsmilie/Raspberry-Pi-3-Weather | 132ed29d7d717e1597d1c5e8dcb5fcf716c81d17 | [
"MIT"
] | null | null | null | from os import path
from pathlib import Path as path_lib
import json
class LanguageManager(object):
def __init__(self):
self._path_to_language_file = 'config/languageConfig.json'
def get_languages(self):
languages = []
language_file_path = path.join(
path.dirname(path.... | 24.142857 | 69 | 0.617751 |
f754c72ffb9265cfed27b504d38730f5d180db82 | 1,743 | py | Python | util.py | eth-sri/transformation-smoothing | 12a653e881a6d61c5c63a3e16d58292435486cbd | [
"Apache-2.0"
] | 3 | 2020-11-07T18:12:50.000Z | 2021-06-11T22:56:09.000Z | util.py | eth-sri/transformation-smoothing | 12a653e881a6d61c5c63a3e16d58292435486cbd | [
"Apache-2.0"
] | null | null | null | util.py | eth-sri/transformation-smoothing | 12a653e881a6d61c5c63a3e16d58292435486cbd | [
"Apache-2.0"
] | null | null | null | import PIL
import PIL.Image
from functional import compose
import numpy as np
import argparse
lmap = compose(list, map)
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse... | 24.208333 | 112 | 0.588067 |
f754fbd282c7e4cd1caf9ef441e8ccd2e128b008 | 1,476 | py | Python | backend/appengine/routes/chamados/rest.py | cbeloni/pychronesapp | fff744dfdbc1932968a950fda614e8ec84d162a3 | [
"MIT"
] | null | null | null | backend/appengine/routes/chamados/rest.py | cbeloni/pychronesapp | fff744dfdbc1932968a950fda614e8ec84d162a3 | [
"MIT"
] | null | null | null | backend/appengine/routes/chamados/rest.py | cbeloni/pychronesapp | fff744dfdbc1932968a950fda614e8ec84d162a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.business import CommandExecutionException
from gaecookie.decorator import no_csrf
from gaepermission.decorator import login_not_required
from tekton.gae.middleware.json_middleware import JsonResponse
from chamado_app impor... | 32.086957 | 77 | 0.79336 |
f75518064427d54bf16e59aa446c4d99ede28d8e | 1,131 | py | Python | Chapter_01/blog/sitemaps.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | 1 | 2021-04-23T16:35:45.000Z | 2021-04-23T16:35:45.000Z | Chapter_01/blog/sitemaps.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | null | null | null | Chapter_01/blog/sitemaps.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | null | null | null | from django.contrib.sitemaps import Sitemap
from .models import Post
class PostSiteMap(Sitemap):
"""
Just a reminder:
We're (simply) override
the (static) attrs of the class 'Sitemap' :P
Some attrs & methods:
changefreq possible vals: 'al... | 31.416667 | 84 | 0.521662 |
f7552098abd265f505cb89767c6bafe1d11daf95 | 153,949 | py | Python | controller/project_controller/projects/WaferFaultDetection_new/best_model_finder/tuner.py | rohandhanraj/Auto-AI-Pipeline | d5f39715c802db45afae0d5978d228bf0bcd2f0a | [
"MIT"
] | null | null | null | controller/project_controller/projects/WaferFaultDetection_new/best_model_finder/tuner.py | rohandhanraj/Auto-AI-Pipeline | d5f39715c802db45afae0d5978d228bf0bcd2f0a | [
"MIT"
] | null | null | null | controller/project_controller/projects/WaferFaultDetection_new/best_model_finder/tuner.py | rohandhanraj/Auto-AI-Pipeline | d5f39715c802db45afae0d5978d228bf0bcd2f0a | [
"MIT"
] | null | null | null | import uuid
import numpy
import pandas
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import GridSearchCV
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC, SVR
from sklearn.tree imp... | 55.377338 | 149 | 0.563362 |
f7552795b727ff23482fa68a2ce214af22fbac6f | 860 | py | Python | tests/data/dependencies_skill/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 126 | 2019-09-07T09:32:44.000Z | 2022-03-29T14:28:41.000Z | tests/data/dependencies_skill/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 1,814 | 2019-08-24T10:08:07.000Z | 2022-03-31T14:28:36.000Z | tests/data/dependencies_skill/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 46 | 2019-09-03T22:13:58.000Z | 2022-03-22T01:25:16.000Z | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 40.952381 | 80 | 0.587209 |
f75534b57eb06254890ba1602ef00ae8f358488b | 1,008 | py | Python | src/data_collection/MatthiasWinkelmann_firstname_database.py | diabolical-ninja/AllTheNames | cdf8a181b80ee3250b76f30cd0b875368d60570c | [
"MIT"
] | null | null | null | src/data_collection/MatthiasWinkelmann_firstname_database.py | diabolical-ninja/AllTheNames | cdf8a181b80ee3250b76f30cd0b875368d60570c | [
"MIT"
] | null | null | null | src/data_collection/MatthiasWinkelmann_firstname_database.py | diabolical-ninja/AllTheNames | cdf8a181b80ee3250b76f30cd0b875368d60570c | [
"MIT"
] | null | null | null | """Firstnames Database from Github User MatthiasWinkelmann.
Source:
- https://github.com/MatthiasWinkelmann/firstname-database
"""
import sys
from pathlib import Path
import pandas as pd
sys.path.append(str(Path(__file__).parent.parent))
import utils as ut # noqa
names_url = "https://raw.githubusercontent.com... | 24.585366 | 115 | 0.729167 |
f75541943a7c2c9b40e140af66050c9c3fd9094b | 1,760 | py | Python | models/encoder_cnn.py | sarrouti/VQG | eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b | [
"MIT"
] | 9 | 2020-08-08T17:48:08.000Z | 2022-03-06T06:51:50.000Z | models/encoder_cnn.py | sarrouti/VQG | eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b | [
"MIT"
] | 2 | 2020-07-04T03:08:36.000Z | 2021-03-22T09:16:21.000Z | models/encoder_cnn.py | sarrouti/VQG | eb9cbe3ba4f75d85fc55f5f1e746b1f2190f0b2b | [
"MIT"
] | 2 | 2020-07-24T02:29:42.000Z | 2021-11-21T20:02:22.000Z |
"""
Created on Tue Jun 23 20:15:11 2020
@author: sarroutim2
"""
"""Genearates a representation for an image input.
"""
import torch.nn as nn
import torch
import torchvision.models as models
class EncoderCNN(nn.Module):
"""Generates a representation for an image input.
"""
def __init__(self, output_si... | 30.877193 | 69 | 0.638636 |
f755629790bb8cde966f4ceb680ec5a084e18788 | 9,889 | py | Python | custom_components/hacs/hacsbase/data.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | 1 | 2021-12-12T18:19:48.000Z | 2021-12-12T18:19:48.000Z | custom_components/hacs/hacsbase/data.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | null | null | null | custom_components/hacs/hacsbase/data.py | Lucstricke/integration | 1543686f3d99c8f16ec4fc37b2edd70b2a3e29a5 | [
"MIT"
] | null | null | null | """Data handler for HACS."""
import asyncio
import os
from homeassistant.core import callback
from custom_components.hacs.helpers.classes.manifest import HacsManifest
from custom_components.hacs.helpers.functions.register_repository import (
register_repository,
)
from custom_components.hacs.helpers.functions.sto... | 42.995652 | 93 | 0.639498 |
f75589efd7c0e17b9ac003f80a1178023e231a53 | 4,811 | py | Python | python-client/swagger_client/models/bucket.py | gabisurita/kinto-codegen-tutorial | b5921ec603df031f9ff25683b7a3fbed5af79094 | [
"MIT"
] | 2 | 2017-03-02T13:12:24.000Z | 2017-10-22T10:31:09.000Z | python-client/swagger_client/models/bucket.py | gabisurita/kinto-codegen-tutorial | b5921ec603df031f9ff25683b7a3fbed5af79094 | [
"MIT"
] | null | null | null | python-client/swagger_client/models/bucket.py | gabisurita/kinto-codegen-tutorial | b5921ec603df031f9ff25683b7a3fbed5af79094 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
kinto
Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch ... | 31.444444 | 938 | 0.594055 |
f7558ac5ccfb283d83840252a788db94af76e9e6 | 605 | py | Python | c2cwsgiutils/sql_profiler/__init__.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cwsgiutils/sql_profiler/__init__.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cwsgiutils/sql_profiler/__init__.py | jhutchings1/c2cwsgiutils | 733f3eace5393539a170455038a27d42682bf4f5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | """
A view (URL=/sql_provider) allowing to enabled/disable a SQL spy that runs an "EXPLAIN ANALYZE" on
every SELECT query going through SQLAlchemy.
"""
import logging
import pyramid.request
from c2cwsgiutils import auth
ENV_KEY = "C2C_SQL_PROFILER_ENABLED"
CONFIG_KEY = "c2c.sql_profiler_enabled"
LOG = logging.getLog... | 24.2 | 98 | 0.73719 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.