hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7244fe77768bd6c98a882c6f7e59a38db5db60e | 317 | py | Python | bin/make_seed.py | pvanheus/runbeast | 1680d8d31318adfe2ae32b66caf8570358c3a2fe | [
"CC0-1.0"
] | null | null | null | bin/make_seed.py | pvanheus/runbeast | 1680d8d31318adfe2ae32b66caf8570358c3a2fe | [
"CC0-1.0"
] | null | null | null | bin/make_seed.py | pvanheus/runbeast | 1680d8d31318adfe2ae32b66caf8570358c3a2fe | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
import sys
from random import SystemRandom
if len(sys.argv) == 2:
seed = sys.argv[1]
else:
seed = '143'
# generate a seed
# e.g. 1433686807619
seedlen = len('1433686807619')
generator = SystemRandom()
for i in range(seedlen-len(seed)):
seed += str(generator.randint(0,9))
print seed
| 15.095238 | 37 | 0.690852 |
cb3aec26a8859eb3b46fe05c2428668da940985d | 158 | py | Python | todoApps_todoapps_taskapp_forms.py | BinduPython100/TodoApps | 73d6e920ab16d685229fac93725bb680f228dc10 | [
"CNRI-Python-GPL-Compatible",
"Apache-2.0",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | todoApps_todoapps_taskapp_forms.py | BinduPython100/TodoApps | 73d6e920ab16d685229fac93725bb680f228dc10 | [
"CNRI-Python-GPL-Compatible",
"Apache-2.0",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | todoApps_todoapps_taskapp_forms.py | BinduPython100/TodoApps | 73d6e920ab16d685229fac93725bb680f228dc10 | [
"CNRI-Python-GPL-Compatible",
"Apache-2.0",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | from django import forms
from .models import TaskForm
class TaskForms(forms.ModelForm):
class Meta:
model = TaskForm
fields = '__all__'
| 17.555556 | 33 | 0.683544 |
baef5962e343dfd18e694f69850e6b7d365f0ac6 | 405 | py | Python | hs_core/migrations/0023_merge.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 1 | 2018-09-17T13:07:29.000Z | 2018-09-17T13:07:29.000Z | hs_core/migrations/0023_merge.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 100 | 2017-08-01T23:48:04.000Z | 2018-04-03T13:17:27.000Z | hs_core/migrations/0023_merge.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 2 | 2017-07-27T20:41:33.000Z | 2017-07-27T22:40:57.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hs_core', '0021_fundingagency'),
('hs_core', '0022_resourcefile_resource_file_size'),
('hs_core', '0022_baseresource_extra_me... | 22.5 | 60 | 0.659259 |
e929d5e4ee9152ff16c68b9e5eef5f4eaad341a9 | 1,031 | py | Python | tests/behavioural/features/steps/thread_state.py | ONSdigital/ras-secure-message | 0713214e89e84ac0c16f2eb075883e4c05d48179 | [
"MIT"
] | 6 | 2017-06-30T12:31:36.000Z | 2018-03-06T12:34:11.000Z | tests/behavioural/features/steps/thread_state.py | ONSdigital/ras-secure-message | 0713214e89e84ac0c16f2eb075883e4c05d48179 | [
"MIT"
] | 97 | 2017-06-28T11:55:43.000Z | 2021-12-24T09:22:17.000Z | tests/behavioural/features/steps/thread_state.py | ONSdigital/ras-secure-message | 0713214e89e84ac0c16f2eb075883e4c05d48179 | [
"MIT"
] | 2 | 2017-05-05T10:31:41.000Z | 2021-04-11T07:46:18.000Z | from behave import given, when
from flask import json
@when("the last returned thread is closed")
@given("the last returned thread is closed")
def step_impl_the_response_message_thread_is_closed(context):
"""close the conversation of the last saved message"""
thread_id = context.bdd_helper.single_message_resp... | 42.958333 | 88 | 0.759457 |
9712fce3e31e0cda05d85259399b461fbc3e44af | 1,216 | py | Python | gpxtrackposter/xy.py | joetimmerman/GpxTrackPoster | d7ff0ba61f6396938efd075d841a7c4a226a6f5d | [
"MIT"
] | 262 | 2016-01-10T17:01:00.000Z | 2022-03-29T09:16:16.000Z | gpxtrackposter/xy.py | joetimmerman/GpxTrackPoster | d7ff0ba61f6396938efd075d841a7c4a226a6f5d | [
"MIT"
] | 75 | 2016-01-10T20:23:42.000Z | 2022-01-10T10:59:18.000Z | gpxtrackposter/xy.py | joetimmerman/GpxTrackPoster | d7ff0ba61f6396938efd075d841a7c4a226a6f5d | [
"MIT"
] | 53 | 2017-01-04T21:12:06.000Z | 2022-01-31T02:39:41.000Z | """Represent x,y coords with properly overloaded operations."""
# Copyright 2016-2021 Florian Pigorsch & Contributors. All rights reserved.
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
from typing import Tuple, Union
class XY:
"""Represent x,y coords wit... | 32 | 75 | 0.602796 |
8feeac5665b3aa32d9733b192f6479f4261a2360 | 1,233 | py | Python | BlackVision/Applications/ProjectManagerPrototype/Location.py | black-vision-engine/bv-engine | 85089d41bb22afeaa9de070646e12aa1777ecedf | [
"MIT"
] | 1 | 2022-01-28T11:43:47.000Z | 2022-01-28T11:43:47.000Z | BlackVision/Applications/ProjectManagerPrototype/Location.py | black-vision-engine/bv-engine | 85089d41bb22afeaa9de070646e12aa1777ecedf | [
"MIT"
] | null | null | null | BlackVision/Applications/ProjectManagerPrototype/Location.py | black-vision-engine/bv-engine | 85089d41bb22afeaa9de070646e12aa1777ecedf | [
"MIT"
] | null | null | null |
class Location:
def __init__(self, projectName, categoryName, path):
self.projectName = projectName # If None == All projects
self.categoryName = categoryName # If None == All categories
self.path = path
def __repr__(self):
return "{} : {} : {}".format(s... | 28.674419 | 144 | 0.581509 |
3d31370fa4c27e7e875125c4438ac935330fcaa6 | 2,336 | py | Python | mytb/tests/test_lru_cache.py | quentinql/mytb | ba0e9626e6f003a514063a098626a7907c50a711 | [
"BSD-3-Clause"
] | null | null | null | mytb/tests/test_lru_cache.py | quentinql/mytb | ba0e9626e6f003a514063a098626a7907c50a711 | [
"BSD-3-Clause"
] | 2 | 2019-09-13T12:17:53.000Z | 2019-10-24T07:09:51.000Z | mytb/tests/test_lru_cache.py | quentinql/mytb | ba0e9626e6f003a514063a098626a7907c50a711 | [
"BSD-3-Clause"
] | 3 | 2017-08-03T13:20:45.000Z | 2021-03-31T13:23:29.000Z | from itertools import count
from mytb.lru_cache import lru_cache
already_called = {}
ctr = count()
ctr2 = count()
def mk_signature(args, kwargs):
sig = tuple(args), tuple(kwargs.items())
print("sig(%s, %s) => %s" % (args, kwargs, sig))
return sig
@lru_cache(maxsize=128)
def tstfunc(*args, **kwargs):
... | 26.850575 | 67 | 0.602312 |
a433bceb7c4d353690d334268be593ee142cd4c3 | 6,205 | py | Python | telemetry/telemetry/core/exceptions.py | bopopescu/chromium72-third-party-catapult | 774e1355b871e13bb858147a136e9cb476f55030 | [
"BSD-3-Clause"
] | 1 | 2019-01-04T10:08:58.000Z | 2019-01-04T10:08:58.000Z | telemetry/telemetry/core/exceptions.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | null | null | null | telemetry/telemetry/core/exceptions.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | 1 | 2019-04-21T23:48:15.000Z | 2019-04-21T23:48:15.000Z | # Copyright 2013 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.
import logging
import sys
class Error(Exception):
"""Base class for Telemetry exceptions."""
def __init__(self, msg=''):
super(Error, self).__init_... | 31.180905 | 79 | 0.723449 |
f6b0ee5b7872b939d4c6e10ab742d7456d09038d | 22,545 | py | Python | models/shape_models.py | mochell/stormy_forerunners | 6ae19e14acded94638578ceeea53ef6ef1bf5198 | [
"MIT"
] | null | null | null | models/shape_models.py | mochell/stormy_forerunners | 6ae19e14acded94638578ceeea53ef6ef1bf5198 | [
"MIT"
] | null | null | null | models/shape_models.py | mochell/stormy_forerunners | 6ae19e14acded94638578ceeea53ef6ef1bf5198 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
execfile(os.environ['PYTHONSTARTUP'])
execfile(STARTUP_IG2018)
%matplotlib inline
#import m_general as M
#import m_earth_geometry as M_geo
#import m_spectrum as spec
#import m_tools as MT
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as s... | 33.599106 | 202 | 0.623686 |
c247f14989510f6159d90acdf38b38bdfd4cc800 | 4,463 | py | Python | lib/tests/test_scalyr.py | aplbrain/boss-manage | dbd8c8e659aefa7b4525259366d11dc4caa8e510 | [
"Apache-2.0"
] | 3 | 2018-02-09T15:48:44.000Z | 2018-04-28T11:54:46.000Z | lib/tests/test_scalyr.py | aplbrain/boss-manage | dbd8c8e659aefa7b4525259366d11dc4caa8e510 | [
"Apache-2.0"
] | 33 | 2018-01-31T16:28:22.000Z | 2021-02-25T20:29:27.000Z | lib/tests/test_scalyr.py | aplbrain/boss-manage | dbd8c8e659aefa7b4525259366d11dc4caa8e510 | [
"Apache-2.0"
] | 8 | 2016-09-27T13:14:25.000Z | 2020-11-13T21:57:21.000Z | # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | 31.878571 | 74 | 0.552319 |
70d7850af5d9b9e0ce789a04b3fd73e22c4b10e9 | 1,292 | py | Python | vedastr/models/utils/upsample.py | csmasters/vedastr | 7513384ab503f15dc574c7d92b75ff2092354757 | [
"Apache-2.0"
] | 475 | 2020-03-17T01:46:32.000Z | 2022-03-29T23:30:15.000Z | vedastr/models/utils/upsample.py | csmasters/vedastr | 7513384ab503f15dc574c7d92b75ff2092354757 | [
"Apache-2.0"
] | 71 | 2020-04-01T04:17:47.000Z | 2021-11-18T06:55:14.000Z | vedastr/models/utils/upsample.py | csmasters/vedastr | 7513384ab503f15dc574c7d92b75ff2092354757 | [
"Apache-2.0"
] | 108 | 2020-02-21T10:30:37.000Z | 2022-03-21T12:03:30.000Z | import torch.nn as nn
import torch.nn.functional as F
from .registry import UTILS
@UTILS.register_module
class Upsample(nn.Module):
__constants__ = ['size', 'scale_factor', 'scale_bias', 'mode', 'align_corners', 'name']
def __init__(self, size=None, scale_factor=None, scale_bias=0, mode='nearest', align_co... | 30.761905 | 103 | 0.603715 |
3413fe2770d23603a25e046dff0824a3007a0f11 | 12,807 | py | Python | codegen/c_generator.py | amchiclet/loopgen | 1a9ed45764ebe7720e9c30a60bbc9525d712044a | [
"MIT"
] | null | null | null | codegen/c_generator.py | amchiclet/loopgen | 1a9ed45764ebe7720e9c30a60bbc9525d712044a | [
"MIT"
] | null | null | null | codegen/c_generator.py | amchiclet/loopgen | 1a9ed45764ebe7720e9c30a60bbc9525d712044a | [
"MIT"
] | 1 | 2021-04-26T16:22:09.000Z | 2021-04-26T16:22:09.000Z | from pathlib import Path
from shutil import copy2
from string import Template
from pattern_ast import (Declaration, Literal, Hex, Assignment,
Access, LoopShape, AbstractLoop, Op, Program, NoOp)
from constant_assignment import VariableMap
def loop_header(loop_var, loop_var_ty, begin, end):
... | 34.427419 | 104 | 0.588272 |
31b300674bc5999ab520503df951df90b1b5119c | 3,333 | py | Python | facebook/sms.py | Team-Exceptions/NewsBuster | 4eb5492a3a2e41293987f719b1f5350ae7286fe5 | [
"MIT"
] | 1 | 2021-03-15T15:38:21.000Z | 2021-03-15T15:38:21.000Z | facebook/sms.py | Team-Exceptions/NewsBuster | 4eb5492a3a2e41293987f719b1f5350ae7286fe5 | [
"MIT"
] | null | null | null | facebook/sms.py | Team-Exceptions/NewsBuster | 4eb5492a3a2e41293987f719b1f5350ae7286fe5 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from fbchat import log, Client
import json
from fbchat import Client
from fbchat.models import *
# Subclass fbchat.Client and override required methods
class EchoBot(Client):
def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs):
self.markAsDeli... | 52.078125 | 143 | 0.59706 |
40cce13dcba2a38a02cef30328f52e91fd6aa02c | 26,222 | py | Python | baseclasses/problems/pyWeight_problem.py | yqliaohk/baseclasses | dac8fbaddeb2f67b031ffc38353cbe8334b9bd03 | [
"Apache-2.0"
] | 6 | 2019-04-18T00:50:08.000Z | 2022-01-11T20:33:44.000Z | baseclasses/problems/pyWeight_problem.py | yqliaohk/baseclasses | dac8fbaddeb2f67b031ffc38353cbe8334b9bd03 | [
"Apache-2.0"
] | 50 | 2019-10-04T16:18:24.000Z | 2022-03-15T22:50:35.000Z | baseclasses/problems/pyWeight_problem.py | yqliaohk/baseclasses | dac8fbaddeb2f67b031ffc38353cbe8334b9bd03 | [
"Apache-2.0"
] | 24 | 2019-07-03T10:35:40.000Z | 2021-07-22T14:52:20.000Z | """
pyWeight_problem
Holds the weightProblem class for weightandbalance solvers.
"""
import numpy
import copy
try:
from pygeo import geo_utils
except ImportError:
geo_utils = None
from ..utils import Error
class WeightProblem:
"""
Weight Problem Object:
This Weight Problem Object should contai... | 32.253383 | 435 | 0.529021 |
4bf3eb0760c9872bda092e90ef5826e1785ffe3a | 11,128 | py | Python | netapp/santricity/models/v2/metadata_change_event.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | netapp/santricity/models/v2/metadata_change_event.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | netapp/santricity/models/v2/metadata_change_event.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | # coding: utf-8
"""
MetadataChangeEvent.py
The Clear BSD License
Copyright (c) – 2016, NetApp, 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 m... | 38.638889 | 844 | 0.657081 |
bc858b72fc4bcfac172d6052f2903b7f8446eac4 | 4,246 | py | Python | xt/model/impala/impala_mlp.py | TianQi-777/xingtian | 9b1678ad6ff12f00c2826a7ec7f42d5350b83b31 | [
"MIT"
] | 240 | 2020-08-15T15:11:49.000Z | 2022-03-28T07:26:23.000Z | xt/model/impala/impala_mlp.py | TianQi-777/xingtian | 9b1678ad6ff12f00c2826a7ec7f42d5350b83b31 | [
"MIT"
] | 20 | 2020-08-29T06:18:21.000Z | 2022-03-21T04:35:57.000Z | xt/model/impala/impala_mlp.py | TianQi-777/xingtian | 9b1678ad6ff12f00c2826a7ec7f42d5350b83b31 | [
"MIT"
] | 69 | 2020-08-15T15:41:53.000Z | 2022-03-16T08:27:47.000Z | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... | 45.170213 | 111 | 0.664154 |
860cb89d83a59a6d010c196bc91ea179cf79c497 | 9,543 | py | Python | electrum_btcc/plugins/email_requests/qt.py | Aaahh/electrum-btcc | 3cf0ee1803af9540334db21daa3817693994e9d0 | [
"MIT"
] | null | null | null | electrum_btcc/plugins/email_requests/qt.py | Aaahh/electrum-btcc | 3cf0ee1803af9540334db21daa3817693994e9d0 | [
"MIT"
] | 5 | 2018-10-12T04:44:06.000Z | 2018-10-12T04:58:10.000Z | electrum_btcc/plugins/email_requests/qt.py | Aaahh/electrum-btcc | 3cf0ee1803af9540334db21daa3817693994e9d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 35.084559 | 103 | 0.638583 |
dad5ba18a51cac45d35973137b1928c4411bfe32 | 70,354 | py | Python | airflow/providers/google/cloud/operators/dataproc.py | wileeam/airflow | f46be8152a4d89c57db4ca46f5b3339e4876b723 | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | airflow/providers/google/cloud/operators/dataproc.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | airflow/providers/google/cloud/operators/dataproc.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.166764 | 150 | 0.64211 |
f3a0ab1453dd389b9d19e75ad586f2819ae7bacc | 846 | py | Python | basic_algorithms_project/Problem_6.py | CTylerD/Data-Structures-Algorithms-Projects | e72248a6433c0242003edf404a715d9f53e3792d | [
"MIT"
] | null | null | null | basic_algorithms_project/Problem_6.py | CTylerD/Data-Structures-Algorithms-Projects | e72248a6433c0242003edf404a715d9f53e3792d | [
"MIT"
] | null | null | null | basic_algorithms_project/Problem_6.py | CTylerD/Data-Structures-Algorithms-Projects | e72248a6433c0242003edf404a715d9f53e3792d | [
"MIT"
] | null | null | null | def get_min_max(ints):
if ints == []:
return ()
min_val = ints[0]
max_val = ints[0]
for item in ints[1:]:
if item > max_val:
max_val = item
if item < min_val:
min_val = item
return (min_val, max_val)
# testing
def test_function(test_cases):
for ... | 26.4375 | 72 | 0.51773 |
d787fe6bf78e531eb8e6f6032eacb3b37f7ae297 | 12,510 | py | Python | utils/synthetic_structsim.py | haophancs/gnn-model-explainer | 71a49392dc2991cecb2a3ccb6d61aa914f1c33e1 | [
"Apache-2.0"
] | 572 | 2019-11-09T08:23:18.000Z | 2022-03-31T07:28:05.000Z | utils/synthetic_structsim.py | haophancs/gnn-model-explainer | 71a49392dc2991cecb2a3ccb6d61aa914f1c33e1 | [
"Apache-2.0"
] | 29 | 2019-12-16T14:26:13.000Z | 2022-02-01T19:59:14.000Z | utils/synthetic_structsim.py | haophancs/gnn-model-explainer | 71a49392dc2991cecb2a3ccb6d61aa914f1c33e1 | [
"Apache-2.0"
] | 135 | 2019-11-11T02:11:50.000Z | 2022-03-16T18:51:09.000Z | """synthetic_structsim.py
Utilities for generating certain graph shapes.
"""
import math
import networkx as nx
import numpy as np
# Following GraphWave's representation of structural similarity
def clique(start, nb_nodes, nb_to_remove=0, role_start=0):
""" Defines a clique (complete graph on n... | 36.366279 | 91 | 0.557794 |
98a29690b1e118e27892e33a98e0b694f8da057d | 8,603 | py | Python | runway/exceptions.py | blade2005/runway | 6e0d543512325a92265c140f386c163f6be410b4 | [
"Apache-2.0"
] | 134 | 2018-02-26T21:35:23.000Z | 2022-03-03T00:30:27.000Z | runway/exceptions.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 937 | 2018-03-08T22:04:35.000Z | 2022-03-30T12:21:47.000Z | runway/exceptions.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 70 | 2018-02-26T23:48:11.000Z | 2022-03-02T18:44:30.000Z | """Runway exceptions."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING, Any, List, Optional, Union
from .utils import DOC_SITE
if TYPE_CHECKING:
from types import ModuleType
from .variables import (
Variable,
VariableValue,
VariableValue... | 27.662379 | 96 | 0.615599 |
622f6000d35f234bdf543884bdd7de58cd3f3673 | 1,429 | py | Python | searchAlgorith/BackTracking/combinationSum2_40.py | soarflighting/LeetCode_Notes | 7870a50311e67f431fa3907c7c6a74453f0795a5 | [
"Apache-2.0"
] | null | null | null | searchAlgorith/BackTracking/combinationSum2_40.py | soarflighting/LeetCode_Notes | 7870a50311e67f431fa3907c7c6a74453f0795a5 | [
"Apache-2.0"
] | null | null | null | searchAlgorith/BackTracking/combinationSum2_40.py | soarflighting/LeetCode_Notes | 7870a50311e67f431fa3907c7c6a74453f0795a5 | [
"Apache-2.0"
] | null | null | null | # 40.组合总和(Medium)
# 题目描述:
# 给定一个数组 candidates 和一个目标数 target ,
# 找出 candidates 中所有可以使数字和为 target 的组合。
# candidates 中的每个数字在每个组合中只能使用一次。
# 说明:
# 所有数字(包括目标数)都是正整数。
# 解集不能包含重复的组合。
# 示例 1:
# 输入: candidates = [10,1,2,7,6,1,5], target = 8,
# 所求解集为:
# [
# [1, 7],
# [1, 2, 5],
# [2, 6],
# [1, 1, 6]
# ]
#... | 27.480769 | 65 | 0.492652 |
bfea7d096f9ac06e1f569e93dd5904780e16e111 | 442 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/count-binary-substrings.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/count-binary-substrings.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/count-binary-substrings.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n)
# Space: O(1)
class Solution(object):
def countBinarySubstrings(self, s):
"""
:type s: str
:rtype: int
"""
result, prev, curr = 0, 0, 1
for i in xrange(1, len(s)):
if s[i-1] != s[i]:
result += min(prev, curr)
... | 22.1 | 41 | 0.420814 |
5dfd76e6fd3a0dbaa1e8f0608f48b2e8e7e61c06 | 4,962 | py | Python | clap/models.py | cfoster0/CLAP | 6414377dc5a461a35a5c75320a4c5effa83df6ae | [
"BSD-3-Clause"
] | 74 | 2021-04-16T07:58:00.000Z | 2022-03-24T11:25:15.000Z | clap/models.py | cfoster0/CLAP | 6414377dc5a461a35a5c75320a4c5effa83df6ae | [
"BSD-3-Clause"
] | 26 | 2021-04-16T07:26:13.000Z | 2021-08-12T07:50:19.000Z | clap/models.py | cfoster0/CLAP | 6414377dc5a461a35a5c75320a4c5effa83df6ae | [
"BSD-3-Clause"
] | 2 | 2021-04-16T18:47:42.000Z | 2021-08-09T06:32:21.000Z | import jax
from typing import Any, Callable, Sequence, Optional
from jax import lax, random, numpy as jnp, vmap, jit
from jax.ops import index, index_update
from .trunks import Transformer, ViT, TNT, CaiT, MLPMixer
# einsum and einops
from jax.numpy import einsum
from einops import rearrange, repeat
# flax
import f... | 34.22069 | 93 | 0.63422 |
9b0a5cd90522bf4befba7f587ef4123a60e3209a | 4,476 | py | Python | tests/components/emulated_hue/test_init.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 1 | 2021-04-08T06:02:25.000Z | 2021-04-08T06:02:25.000Z | tests/components/emulated_hue/test_init.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 1 | 2022-03-12T01:05:00.000Z | 2022-03-12T01:05:00.000Z | tests/components/emulated_hue/test_init.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 1 | 2019-04-16T14:07:20.000Z | 2019-04-16T14:07:20.000Z | """Test the Emulated Hue component."""
import json
from unittest.mock import patch, Mock, mock_open, MagicMock
from homeassistant.components.emulated_hue import Config
def test_config_google_home_entity_id_to_number():
"""Test config adheres to the type."""
mock_hass = Mock()
mock_hass.config.path = Mag... | 35.244094 | 72 | 0.580652 |
401e72b3d91e108f53a22be45de842555bc5a145 | 9,541 | py | Python | nlpsandbox/model/annotation.py | Sage-Bionetworks/nlp-sandbox-client | e51720b35ca3413ccee71b9cdc223ce3578fe0fd | [
"Apache-2.0"
] | 3 | 2021-06-15T16:36:10.000Z | 2021-11-15T01:44:46.000Z | nlpsandbox/model/annotation.py | nlpsandbox/nlpsandbox-client | 8cba4f65ff2c06cbef7dc50f45b0aec9b8ee0476 | [
"Apache-2.0"
] | 165 | 2020-11-23T00:36:40.000Z | 2022-03-24T00:53:59.000Z | nlpsandbox/model/annotation.py | data2health/nlp-sandbox-evaluation | e51720b35ca3413ccee71b9cdc223ce3578fe0fd | [
"Apache-2.0"
] | 3 | 2020-12-11T00:04:13.000Z | 2022-01-03T16:59:10.000Z | """
NLP Sandbox API
NLP Sandbox REST API # noqa: E501
The version of the OpenAPI document: 1.2.0
Contact: team@nlpsandbox.io
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from nlpsandbox.model_utils import ( # noqa: F401
ApiTypeError,
... | 45.004717 | 136 | 0.630961 |
8e22d1974d6cb1ef305037a6d8bc56c2755cc3dd | 1,179 | py | Python | tests/test_conversion.py | Sillte/fairyimage | 1b84136984d392b187712333064da707e42bbb6e | [
"MIT"
] | null | null | null | tests/test_conversion.py | Sillte/fairyimage | 1b84136984d392b187712333064da707e42bbb6e | [
"MIT"
] | null | null | null | tests/test_conversion.py | Sillte/fairyimage | 1b84136984d392b187712333064da707e42bbb6e | [
"MIT"
] | null | null | null | import pytest
from pathlib import Path
from PIL import Image
import fairyimage
from fairyimage import from_source
from fairyimage import conversion
from fairyimage.conversion import PygmentsCaller
from fairyimage.conversion.pygments_ext import WinFontCollector
def test_from_source():
script = Path(__file... | 26.2 | 64 | 0.728584 |
40f65b68bb71330697c0c2075ef6edf3fb6937c1 | 1,041 | py | Python | study/hed/main.py | shadowcz007/xdesign-template | 08b28233762e664d335503e9a43d79227318a7f3 | [
"MIT"
] | 1 | 2021-05-22T19:35:58.000Z | 2021-05-22T19:35:58.000Z | study/hed/main.py | shadowcz007/xdesign-template | 08b28233762e664d335503e9a43d79227318a7f3 | [
"MIT"
] | null | null | null | study/hed/main.py | shadowcz007/xdesign-template | 08b28233762e664d335503e9a43d79227318a7f3 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib.pyplot as plt
# 加载模型
# hed_pretrained_bsds.caffemodel预训练模型下载http://vcl.ucsd.edu/hed/hed_pretrained_bsds.caffemodel
# deploy.prototxt 下载https://github.com/s9xie/hed/tree/master/examples/hed
net = cv2.dnn.readNet('model/deploy.prototxt', 'model/hed_pretrained_bsds.caffemod... | 28.916667 | 93 | 0.708934 |
5a9a53ed188e9615ce28036647292c72de5b2d75 | 1,717 | py | Python | testplan/common/utils/thread.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/common/utils/thread.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/common/utils/thread.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:13:18.000Z | 2019-09-11T09:13:18.000Z | """Threading utilities."""
import time
import threading
from .timing import TimeoutException
def execute_as_thread(target, args=None, kwargs=None, daemon=False, join=True,
break_join=None, join_sleep=0.01, timeout=None):
"""
Execute target callable in a separate thread.
:param tar... | 31.218182 | 78 | 0.605708 |
cb758d119bc6cfc1abd950f02641e8a1b1561a90 | 25,194 | py | Python | src/genie/libs/parser/nxos/tests/test_show_eigrp.py | kacann/genieparser | 76e19003199c393c59a33546726de3ff5486da80 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/nxos/tests/test_show_eigrp.py | kacann/genieparser | 76e19003199c393c59a33546726de3ff5486da80 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/nxos/tests/test_show_eigrp.py | kacann/genieparser | 76e19003199c393c59a33546726de3ff5486da80 | [
"Apache-2.0"
] | 1 | 2021-07-07T18:07:56.000Z | 2021-07-07T18:07:56.000Z | # Python
import unittest
from unittest.mock import Mock
# ATS
from ats.topology import Device
# Metaparser
from genie.metaparser.util.exceptions import SchemaEmptyParserError
# nxos show ip eigrp
from genie.libs.parser.nxos.show_eigrp import ShowIpv4EigrpNeighbors,\
... | 56.488789 | 101 | 0.262642 |
286954c8d1af529e6770594a7f148aa5f4b4a927 | 5,832 | py | Python | tests/test_types.py | pygfx/pyshader | 804f2a63221b40434ebcbeb4a01eeebe0d361a90 | [
"BSD-2-Clause"
] | 48 | 2020-07-19T15:55:08.000Z | 2022-03-21T15:02:45.000Z | tests/test_types.py | almarklein/python-shader | 804f2a63221b40434ebcbeb4a01eeebe0d361a90 | [
"BSD-2-Clause"
] | 22 | 2019-12-31T16:01:28.000Z | 2020-06-15T20:03:58.000Z | tests/test_types.py | almarklein/spirv-py | 804f2a63221b40434ebcbeb4a01eeebe0d361a90 | [
"BSD-2-Clause"
] | 2 | 2020-10-12T09:42:28.000Z | 2021-03-04T08:20:19.000Z | import ctypes
from pyshader import _types as types, shadertype_as_ctype
from pytest import raises
def test_simple():
assert types.type_from_name("f32") is types.f32
assert types.f32.__name__ == "f32"
for t in [types.i16, types.i32, types.i64]:
assert isinstance(t, type) and issubclass(t, types... | 29.755102 | 88 | 0.60751 |
4334d019254efc072b77dd8a7ba4df225c0e5f06 | 724 | py | Python | 283. Move Zeroes/Using_pointer.py | tulsishankarreddy/leetcode | fffe90b0ab43a57055c248550f31ac18967fe183 | [
"MIT"
] | 1 | 2022-01-19T16:26:49.000Z | 2022-01-19T16:26:49.000Z | 283. Move Zeroes/Using_pointer.py | tulsishankarreddy/leetcode | fffe90b0ab43a57055c248550f31ac18967fe183 | [
"MIT"
] | null | null | null | 283. Move Zeroes/Using_pointer.py | tulsishankarreddy/leetcode | fffe90b0ab43a57055c248550f31ac18967fe183 | [
"MIT"
] | null | null | null | ''' The solution first edits the array with non zero values from the initial postion. After updating all the
valid values at the front part of the array, rest of the array positions are filled with zeros '''
class Solution:
def moveZeroes(self, nums: List[int]) -> None:
"""
Do not return anything,... | 36.2 | 108 | 0.578729 |
40c74bb7e7eae0afeecebdc3d53ae11ceb53fff1 | 74,632 | py | Python | snooty/test_parser.py | mongodb/snooty-parser | d21f824c13f14bd856ebd360bcfecd7ebcb574c0 | [
"Apache-2.0",
"CNRI-Python-GPL-Compatible"
] | 15 | 2019-04-25T15:38:31.000Z | 2022-01-21T00:09:29.000Z | snooty/test_parser.py | mongodb/snooty-parser | d21f824c13f14bd856ebd360bcfecd7ebcb574c0 | [
"Apache-2.0",
"CNRI-Python-GPL-Compatible"
] | 69 | 2019-03-05T02:30:41.000Z | 2022-03-02T17:51:08.000Z | snooty/test_parser.py | mongodb/snooty-parser | d21f824c13f14bd856ebd360bcfecd7ebcb574c0 | [
"Apache-2.0",
"CNRI-Python-GPL-Compatible"
] | 33 | 2019-02-05T21:18:17.000Z | 2021-12-13T18:24:22.000Z | from pathlib import Path
from . import rstparser
from .diagnostics import (
CannotOpenFile,
Diagnostic,
DocUtilsParseError,
ErrorParsingYAMLFile,
ExpectedPathArg,
IncorrectLinkSyntax,
IncorrectMonospaceSyntax,
InvalidField,
InvalidLiteralInclude,
InvalidURL,
MakeCorrectionMi... | 26.663809 | 223 | 0.596688 |
40a2779893ec33ac346d629fd3c9fc0672fd28fa | 14,145 | py | Python | baseframe/forms/form.py | hasgeek/baseframe | 9257e1c0f996905e7209f6a09e043204e65757b2 | [
"BSD-2-Clause"
] | 7 | 2015-12-24T02:05:27.000Z | 2021-06-03T21:34:19.000Z | baseframe/forms/form.py | hasgeek/baseframe | 9257e1c0f996905e7209f6a09e043204e65757b2 | [
"BSD-2-Clause"
] | 127 | 2015-01-02T14:25:44.000Z | 2021-09-22T07:56:30.000Z | baseframe/forms/form.py | hasgeek/baseframe | 9257e1c0f996905e7209f6a09e043204e65757b2 | [
"BSD-2-Clause"
] | 10 | 2015-02-08T04:55:56.000Z | 2020-06-23T20:59:48.000Z | from threading import Lock
from typing import Callable, Dict, Iterable, Optional, Tuple, Type, Union
import uuid
from flask import current_app
from flask_wtf import FlaskForm as BaseForm
import wtforms
from ..extensions import __, asset_cache
from ..signals import form_validation_error, form_validation_success
from .... | 38.966942 | 88 | 0.616896 |
61b00299bda5d6b6065276446cee5d79c0489d5f | 408 | py | Python | Python3/scripts-python3/desafios/mundo03/desafio104.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | Python3/scripts-python3/desafios/mundo03/desafio104.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | Python3/scripts-python3/desafios/mundo03/desafio104.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | def leia_int(msg):
print('-' * 30)
ok = False
valor = 0
while True:
n = str(input(msg))
if n.isnumeric():
valor = int(n)
ok = True
else:
print('\033[31mERRO! Digite um número inteiro válido.\033[m')
if ok:
break
return v... | 21.473684 | 73 | 0.509804 |
4bd54bc3d6749c5db6197242944da3656ad595a1 | 11,529 | py | Python | napalm_yang/models/openconfig/interfaces/interface/routed_vlan/ipv4/addresses/address/vrrp/vrrp_group/interface_tracking/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/interfaces/interface/routed_vlan/ipv4/addresses/address/vrrp/vrrp_group/interface_tracking/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/interfaces/interface/routed_vlan/ipv4/addresses/address/vrrp/vrrp_group/interface_tracking/state/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 39.892734 | 586 | 0.602914 |
af94ffcd489eee2513cfbe0423569cb34a60c9d2 | 40,233 | py | Python | qiskit/tools/qcvv/tomography.py | Shark-y/qiskit-sdk-py | c1361b823dc1a3fab76545e62975c2afb02e442d | [
"Apache-2.0"
] | 1 | 2019-03-08T16:25:23.000Z | 2019-03-08T16:25:23.000Z | qiskit/tools/qcvv/tomography.py | Shark-y/qiskit-sdk-py | c1361b823dc1a3fab76545e62975c2afb02e442d | [
"Apache-2.0"
] | 38 | 2017-08-04T09:57:36.000Z | 2017-08-23T10:35:32.000Z | qiskit/tools/qcvv/tomography.py | Shark-y/qiskit-sdk-py | c1361b823dc1a3fab76545e62975c2afb02e442d | [
"Apache-2.0"
] | 1 | 2020-12-13T23:03:20.000Z | 2020-12-13T23:03:20.000Z | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# Copyright 2017 IBM RESEARCH. 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/licen... | 36.809698 | 79 | 0.588248 |
ac2ea9d0b1bb0d1457caf5a976b9585913410d25 | 107,078 | py | Python | python/tvm/relay/frontend/tensorflow.py | Yichun1492/incubator-tvm | a6c42b34782059b82c56ac53a9df63d55e452120 | [
"Apache-2.0"
] | 1 | 2020-04-15T02:21:38.000Z | 2020-04-15T02:21:38.000Z | python/tvm/relay/frontend/tensorflow.py | Yichun1492/incubator-tvm | a6c42b34782059b82c56ac53a9df63d55e452120 | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/frontend/tensorflow.py | Yichun1492/incubator-tvm | a6c42b34782059b82c56ac53a9df63d55e452120 | [
"Apache-2.0"
] | null | null | null |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not ... | 40.179362 | 108 | 0.549926 |
6d2f470b4c3fb4fec7ba2a2c4641601a08414007 | 1,978 | py | Python | comment/form.py | herschel-ma/django_blogsite_and_more | 41310aa96f4288e7ac7880ea6cdcd0964e1322fb | [
"MIT"
] | null | null | null | comment/form.py | herschel-ma/django_blogsite_and_more | 41310aa96f4288e7ac7880ea6cdcd0964e1322fb | [
"MIT"
] | 4 | 2020-03-12T08:45:37.000Z | 2022-03-12T01:02:37.000Z | comment/form.py | herschel-ma/django_blogsite_and_more | 41310aa96f4288e7ac7880ea6cdcd0964e1322fb | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.contenttypes.models import ContentType
from django.db.models import ObjectDoesNotExist
from ckeditor.widgets import CKEditorWidget
from .models import Comment
class CommentForm(forms.Form):
content_type = forms.CharField(widget=forms.HiddenInput)
object_id = forms.I... | 43 | 100 | 0.664813 |
60e2e6dfb1fe5a29822e9729687513eebb601d9a | 606 | py | Python | dbaas/physical/service/databaseinfra.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | 303 | 2015-01-08T10:35:54.000Z | 2022-02-28T08:54:06.000Z | dbaas/physical/service/databaseinfra.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 124 | 2015-01-14T12:56:15.000Z | 2022-03-22T20:45:11.000Z | dbaas/physical/service/databaseinfra.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 110 | 2015-01-02T11:59:48.000Z | 2022-02-28T08:54:06.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django_services import service
from ..models import DatabaseInfra
from drivers import factory_for
from django_services.service import checkpermission
LOG = logging.getLogger(__name__)
class DatabaseInfraService(servi... | 28.857143 | 56 | 0.788779 |
c579caf7fa2d581857cea67a925717b2c1fddf86 | 37,880 | py | Python | pytransform3d/visualizer/_artists.py | rock-learning/pytransform | c73f673ec54eee17f3adadb4040b65380798b0d3 | [
"BSD-3-Clause"
] | 3 | 2017-05-19T13:36:29.000Z | 2018-05-31T07:41:27.000Z | pytransform3d/visualizer/_artists.py | rock-learning/pytransform | c73f673ec54eee17f3adadb4040b65380798b0d3 | [
"BSD-3-Clause"
] | 16 | 2018-07-09T12:54:01.000Z | 2018-11-08T15:03:07.000Z | pytransform3d/visualizer/_artists.py | rock-learning/pytransform | c73f673ec54eee17f3adadb4040b65380798b0d3 | [
"BSD-3-Clause"
] | null | null | null | """Visualizer artists."""
import warnings
from itertools import chain
import numpy as np
import open3d as o3d
from .. import rotations as pr
from .. import transformations as pt
from .. import urdf
class Artist:
"""Abstract base class for objects that can be rendered."""
def add_artist(self, figure):
... | 31.619366 | 82 | 0.572571 |
2f4fe02493e0ed895121ddfc1e15e9f6dc7a52b3 | 28,328 | py | Python | custom_components/samsungtv_custom/media_player.py | reindrich/home-assistant-config | a2e5b766b5b58bd092b0c23e91e5dd8def49ea81 | [
"MIT"
] | 1 | 2021-12-17T20:30:58.000Z | 2021-12-17T20:30:58.000Z | custom_components/samsungtv_custom/media_player.py | reindrich/home-assistant-config | a2e5b766b5b58bd092b0c23e91e5dd8def49ea81 | [
"MIT"
] | null | null | null | custom_components/samsungtv_custom/media_player.py | reindrich/home-assistant-config | a2e5b766b5b58bd092b0c23e91e5dd8def49ea81 | [
"MIT"
] | null | null | null | """Support for interface with an Samsung TV."""
import asyncio
from datetime import timedelta
import logging
import socket
import json
import voluptuous as vol
import os
import websocket
import wakeonlan
import time
import requests
from homeassistant import util
from homeassistant.components.media_player import MediaP... | 32.045249 | 106 | 0.596124 |
fd0287ecb79bbaa483185202437bbbfd10ebaecc | 2,636 | py | Python | brave.py | ManagerBitten/Token-Logger | 5f0ce356d538d2609fde4506c80a024e58c30641 | [
"Apache-2.0"
] | 2 | 2021-07-24T21:35:51.000Z | 2022-02-06T18:41:57.000Z | brave.py | ManagerBitten/Token-Logger | 5f0ce356d538d2609fde4506c80a024e58c30641 | [
"Apache-2.0"
] | 2 | 2021-07-25T03:24:18.000Z | 2021-09-30T01:35:07.000Z | brave.py | ManagerBitten/Token-Logger | 5f0ce356d538d2609fde4506c80a024e58c30641 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import os
import shutil
import sqlite3
import win32crypt
from Crypto.Cipher import AES
TEMP = os.getenv("TEMP")
ROAMING = os.getenv("APPDATA")
LOCAL = os.getenv("LOCALAPPDATA")
def bothInstalled():
chrome = False
brave = False
if os.path.exists(LOCAL + r'\BraveSoftware\Brave-Br... | 30.651163 | 122 | 0.627845 |
e6a115a2f53a1db7b20c82397bf17b683106b8c4 | 7,192 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_global_address_info.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_global_address_info.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_global_address_info.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 33.296296 | 143 | 0.604561 |
173225a172b03d0ddf1a809a7600e34537c64ed6 | 9,856 | py | Python | tensorflow_text/python/ops/split_merge_tokenizer.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | tensorflow_text/python/ops/split_merge_tokenizer.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | tensorflow_text/python/ops/split_merge_tokenizer.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 TF.Text Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 44.597285 | 123 | 0.642147 |
b33d8e4a7e6cb5abfb3dc6070a224b3e24034792 | 15,498 | py | Python | pipeline_plugins/cmdb_ip_picker/utils.py | chenrb/bk-sops | bed16e9473ba45793b7f45620d8cd6f1ae16ac5d | [
"Apache-2.0"
] | null | null | null | pipeline_plugins/cmdb_ip_picker/utils.py | chenrb/bk-sops | bed16e9473ba45793b7f45620d8cd6f1ae16ac5d | [
"Apache-2.0"
] | null | null | null | pipeline_plugins/cmdb_ip_picker/utils.py | chenrb/bk-sops | bed16e9473ba45793b7f45620d8cd6f1ae16ac5d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 31.888889 | 117 | 0.544844 |
015564d719af1ffd5a4a7c177fc0221b83e53c93 | 4,110 | py | Python | data_managers/data_manager_bowtie_index_builder/data_manager/bowtie_index_builder.py | supernord/tools-iuc | 9a0c41967765d120a8fc519c0c7f09cbe3a6efbe | [
"MIT"
] | 142 | 2015-03-13T18:08:34.000Z | 2022-03-30T23:52:34.000Z | data_managers/data_manager_bowtie_index_builder/data_manager/bowtie_index_builder.py | mtekman/tools-iuc | 95f1ae4ed1cdd56114df76d215f9e1ed549aa4c5 | [
"MIT"
] | 3,402 | 2015-01-05T18:04:20.000Z | 2022-03-30T22:09:36.000Z | data_managers/data_manager_bowtie_index_builder/data_manager/bowtie_index_builder.py | willemdek11/tools-iuc | dc0a0cf275168c2a88ee3dc47652dd7ca1137871 | [
"MIT"
] | 438 | 2015-01-07T20:33:59.000Z | 2022-03-30T04:39:18.000Z | #!/usr/bin/env python
from __future__ import print_function
import json
import optparse
import os
import subprocess
import sys
import tempfile
CHUNK_SIZE = 2**20
DEFAULT_DATA_TABLE_NAME = "bowtie_indexes"
def get_id_name(params, dbkey, fasta_description=None):
# TODO: ensure sequence_id is unique and does not ... | 41.1 | 227 | 0.727737 |
6766ae3cf570e0474114f800fa7c821b37bc36d9 | 18,338 | py | Python | effdet/config/model_config.py | nodiz/efficientdet-pytorch | dec88af00a365726b4eebc8147eee98cbbbb7ad3 | [
"Apache-2.0"
] | null | null | null | effdet/config/model_config.py | nodiz/efficientdet-pytorch | dec88af00a365726b4eebc8147eee98cbbbb7ad3 | [
"Apache-2.0"
] | null | null | null | effdet/config/model_config.py | nodiz/efficientdet-pytorch | dec88af00a365726b4eebc8147eee98cbbbb7ad3 | [
"Apache-2.0"
] | 1 | 2021-11-23T08:36:08.000Z | 2021-11-23T08:36:08.000Z | """EfficientDet Configurations
Adapted from official impl at https://github.com/google/automl/tree/master/efficientdet
TODO use a different config system (OmegaConfig -> Hydra?), separate model from train specific hparams
"""
from omegaconf import OmegaConf
from copy import deepcopy
def default_detection_model_con... | 34.022263 | 122 | 0.637474 |
21c0aa2f9d58ad08509494f364a32be948c8d43e | 12,156 | py | Python | tests/cron_job_tests/test_retention_eligible_import_task.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | tests/cron_job_tests/test_retention_eligible_import_task.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | tests/cron_job_tests/test_retention_eligible_import_task.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | import datetime
import pytz
from tests import test_data
from rdr_service.api_util import open_cloud_file
from rdr_service.offline import retention_eligible_import
from rdr_service import clock
from rdr_service.participant_enums import RetentionStatus, RetentionType
from tests.helpers.unittest_base import BaseTestCase
... | 53.082969 | 113 | 0.702205 |
5073471192cc935d4e5a36625dd4558e84f2a4aa | 2,439 | py | Python | selfdrive/manager/process_config.py | YHKIM71/openpilot083 | 1b56d7de87efd3a3c12ecd178d2e8ff0fbaad4e9 | [
"MIT"
] | 2 | 2020-10-22T09:20:14.000Z | 2020-10-22T09:20:20.000Z | selfdrive/manager/process_config.py | oht-volt/cj_volt | a11d12fbe909b93aa610df9a1c3c02601b726649 | [
"MIT"
] | null | null | null | selfdrive/manager/process_config.py | oht-volt/cj_volt | a11d12fbe909b93aa610df9a1c3c02601b726649 | [
"MIT"
] | null | null | null | import os
from selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
from selfdrive.hardware import EON, TICI, PC
WEBCAM = os.getenv("WEBCAM") is not None
procs = [
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
# due to qualcomm kernel bugs SIGKILLing ca... | 60.975 | 127 | 0.746207 |
dd0c43fe22a23a9b1b367c6d446e21fa32b0cd78 | 653 | py | Python | lisa/__init__.py | JaimeVHArm/lisa | e5dcb7d54f73d57d4071da87c7c8095ba351a899 | [
"Apache-2.0"
] | 1 | 2020-11-30T16:14:02.000Z | 2020-11-30T16:14:02.000Z | lisa/__init__.py | JaimeVHArm/lisa | e5dcb7d54f73d57d4071da87c7c8095ba351a899 | [
"Apache-2.0"
] | null | null | null | lisa/__init__.py | JaimeVHArm/lisa | e5dcb7d54f73d57d4071da87c7c8095ba351a899 | [
"Apache-2.0"
] | null | null | null | from lisa.version import __version__
import warnings
# Raise an exception when a deprecated API is used from within a lisa.*
# submodule. This ensures that we don't use any deprecated APIs internally, so
# they are only kept for external backward compatibility purposes.
warnings.filterwarnings(
action='error',
... | 29.681818 | 78 | 0.756508 |
07ed03e9fb2f4c78998d7df7b05dccc236a4fd35 | 1,137 | py | Python | models/gcn_conv_input_mat.py | Eurus-Holmes/Tumor2Graph | 6e52748d8cd2e8fe33092e2c67e92e6454a964b3 | [
"MIT"
] | 4 | 2021-10-10T19:37:29.000Z | 2022-02-27T10:21:28.000Z | models/gcn_conv_input_mat.py | Eurus-Holmes/Tumor2Graph | 6e52748d8cd2e8fe33092e2c67e92e6454a964b3 | [
"MIT"
] | null | null | null | models/gcn_conv_input_mat.py | Eurus-Holmes/Tumor2Graph | 6e52748d8cd2e8fe33092e2c67e92e6454a964b3 | [
"MIT"
] | null | null | null | import torch.nn.functional as F
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from models.model_utils import get_laplace_mat
class GCNConv(nn.Module):
def __init__(self,
in_channels,
out_channels,
improved=False,
dr... | 28.425 | 61 | 0.602463 |
2ce65a85120e44b9a126314d2c93b227e2db64ef | 1,953 | py | Python | env/Lib/site-packages/OpenGL/GL/AMD/framebuffer_sample_positions.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GL/AMD/framebuffer_sample_positions.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GL/AMD/framebuffer_sample_positions.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension AMD.framebuffer_sample_positions
This module customises the behaviour of the
OpenGL.raw.GL.AMD.framebuffer_sample_positions to provide a more
Python-friendly API
Overview (from the spec)
In unextended GL, the sub-pixel loations of multisampled textures and
renderbuffers are generally determi... | 44.386364 | 76 | 0.817204 |
f08af51a3348d690306c4fa0a82f60883a5f0f53 | 1,809 | py | Python | lib/model/psroi_pooling/functions/psroi_pooling.py | lzhangbj/Tracking | 1cb3d28f95c6e9bbe27c1eec8b0cb19cc2045ff0 | [
"MIT"
] | null | null | null | lib/model/psroi_pooling/functions/psroi_pooling.py | lzhangbj/Tracking | 1cb3d28f95c6e9bbe27c1eec8b0cb19cc2045ff0 | [
"MIT"
] | null | null | null | lib/model/psroi_pooling/functions/psroi_pooling.py | lzhangbj/Tracking | 1cb3d28f95c6e9bbe27c1eec8b0cb19cc2045ff0 | [
"MIT"
] | null | null | null | import torch
from torch.autograd import Function
from .._ext import psroi_pooling
class PSRoIPoolingFunction(Function):
def __init__(self, pooled_height, pooled_width, spatial_scale, group_size, output_dim):
self.pooled_width = int(pooled_width)
self.pooled_height = int(pooled_height)
sel... | 42.069767 | 143 | 0.713654 |
229a1c615eaf71cd87f0f14a9f963a18a2e42d9d | 19,455 | py | Python | settings.py | DiscordJaiiime/Starboard | 1d2fc74dad98cb98fbc91af402fcb4c694eb4d47 | [
"MIT"
] | 64 | 2020-09-16T21:35:19.000Z | 2022-03-25T20:18:58.000Z | settings.py | DiscordJaiiime/Starboard | 1d2fc74dad98cb98fbc91af402fcb4c694eb4d47 | [
"MIT"
] | 8 | 2020-10-23T02:03:12.000Z | 2022-03-05T20:51:55.000Z | settings.py | DiscordJaiiime/Starboard | 1d2fc74dad98cb98fbc91af402fcb4c694eb4d47 | [
"MIT"
] | 19 | 2020-10-29T01:58:48.000Z | 2021-10-10T03:28:29.000Z | from typing import Union, Optional
import discord
from discord.ext import commands
import errors
import functions
from database.database import Database # for type hinting
from errors import DoesNotExist
async def change_starboard_settings(
db: Database,
starboard_id: int,
self_star: bool = None,
l... | 30.303738 | 79 | 0.5468 |
3fa278f75b55f5eba7825e28758d4e236300878d | 3,593 | py | Python | sphinxcontrib/SphinxRest.py | yishenggudou/sphinx-rest-api-doc | 8ecc23d9cc3009d5c38c5718b51159b1722c0058 | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/SphinxRest.py | yishenggudou/sphinx-rest-api-doc | 8ecc23d9cc3009d5c38c5718b51159b1722c0058 | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/SphinxRest.py | yishenggudou/sphinx-rest-api-doc | 8ecc23d9cc3009d5c38c5718b51159b1722c0058 | [
"BSD-2-Clause"
] | 1 | 2018-10-11T02:10:33.000Z | 2018-10-11T02:10:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from docutils import nodes
from docutils.parsers.rst import directives, Directive
from docutils.statemachine import ViewList
from sphinx.util.nodes import nested_parse_with_titles
from .RestAPIContext import RestAPIContext
import os
try:
from StringIO import ... | 31.79646 | 98 | 0.663234 |
5a9aee2985a3cc0dafc3f0de79dd545ab1be2398 | 63,266 | py | Python | setup.py | mkutsovsky/horovod | 6c80085a3c162947e37d331d2b9b371b724bb61d | [
"Apache-2.0"
] | null | null | null | setup.py | mkutsovsky/horovod | 6c80085a3c162947e37d331d2b9b371b724bb61d | [
"Apache-2.0"
] | null | null | null | setup.py | mkutsovsky/horovod | 6c80085a3c162947e37d331d2b9b371b724bb61d | [
"Apache-2.0"
] | 1 | 2020-02-02T21:08:32.000Z | 2020-02-02T21:08:32.000Z | # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
# Modifications copyright Microsoft
#
# 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/LICENS... | 40.790458 | 147 | 0.616903 |
7e90d455a165ee4a380445642de7b3713c08c351 | 3,252 | py | Python | github_user_manager.py | envato-content/github_user_mananger | aec270a65c81c7051746764e4ac30620b7eafd86 | [
"MIT"
] | 1 | 2020-01-05T19:12:18.000Z | 2020-01-05T19:12:18.000Z | github_user_manager.py | envato-content/github_user_mananger | aec270a65c81c7051746764e4ac30620b7eafd86 | [
"MIT"
] | 1 | 2020-03-18T08:06:47.000Z | 2020-03-18T08:06:47.000Z | github_user_manager.py | denmat/github_user_mananger | 7dbb4fdfe909f99479f66e371a10e725eead976a | [
"MIT"
] | 2 | 2018-06-25T06:16:45.000Z | 2018-12-30T22:54:40.000Z | from cement.core.foundation import CementApp
from cement.core.controller import CementBaseController, expose
from lib.github_user_manager import GithubUserManager
from config import Config as Configuration
BANNER = """
github_users_manager.py %s
This manages Github users on local Linux systems - using an organisatio... | 34.967742 | 123 | 0.622694 |
60fa4c217d10a4780d32c71c4891e507519058f4 | 1,549 | py | Python | cmsplugin_photologue_pro/templatetags/cmsplugin_photologue_pro_tags.py | binarity/cmsplugin-photologue-pro | dbad2f9cb06274efbdf28b0639ca67ba38d04ef0 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_photologue_pro/templatetags/cmsplugin_photologue_pro_tags.py | binarity/cmsplugin-photologue-pro | dbad2f9cb06274efbdf28b0639ca67ba38d04ef0 | [
"BSD-3-Clause"
] | null | null | null | cmsplugin_photologue_pro/templatetags/cmsplugin_photologue_pro_tags.py | binarity/cmsplugin-photologue-pro | dbad2f9cb06274efbdf28b0639ca67ba38d04ef0 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from django import template
from django.utils import formats
from photologue import models
register = template.Library()
def get_exif_data(photo, attr):
value = photo.EXIF.get(attr)
if value is None:
return
if attr == 'EXIF DateTimeOriginal':
dt = datetime.st... | 28.163636 | 66 | 0.619109 |
086d56c5ed00c9e86fc9f756879842c58c4eac40 | 141 | py | Python | libs/FileUtil.py | bugbound/jsfs | 2471b1b78b54f604e0cf2b0bc9b325f7890c0abb | [
"MIT"
] | 2 | 2019-12-27T19:25:15.000Z | 2020-02-04T13:31:26.000Z | libs/FileUtil.py | bugbound/jsfs | 2471b1b78b54f604e0cf2b0bc9b325f7890c0abb | [
"MIT"
] | null | null | null | libs/FileUtil.py | bugbound/jsfs | 2471b1b78b54f604e0cf2b0bc9b325f7890c0abb | [
"MIT"
] | null | null | null | class FileUtil:
@staticmethod
def read_file(filename):
f = open(filename, 'r')
filecontent = f.read()
f.close()
return filecontent
| 17.625 | 25 | 0.695035 |
5d9eb06833b2da8bb602bfe2e7d8066a07d63363 | 52 | py | Python | examples/extensions/ncvx/__init__.py | quantopian/cvxpy | 7deee4d172470aa8f629dab7fead50467afa75ff | [
"Apache-2.0"
] | 5 | 2017-08-31T01:37:00.000Z | 2022-03-24T04:23:09.000Z | examples/extensions/ncvx/__init__.py | quantopian/cvxpy | 7deee4d172470aa8f629dab7fead50467afa75ff | [
"Apache-2.0"
] | null | null | null | examples/extensions/ncvx/__init__.py | quantopian/cvxpy | 7deee4d172470aa8f629dab7fead50467afa75ff | [
"Apache-2.0"
] | 6 | 2017-02-09T19:37:07.000Z | 2021-01-07T00:17:54.000Z | import branch_and_bound
from boolean import Boolean
| 17.333333 | 27 | 0.884615 |
b2bc1fe0993eaa7091f599f0561887de68e3459c | 25,661 | py | Python | awkward/array/masked.py | lgray/awkward-array | 557aa0c558c427312f624a6c01557ec6be01ab80 | [
"BSD-3-Clause"
] | null | null | null | awkward/array/masked.py | lgray/awkward-array | 557aa0c558c427312f624a6c01557ec6be01ab80 | [
"BSD-3-Clause"
] | null | null | null | awkward/array/masked.py | lgray/awkward-array | 557aa0c558c427312f624a6c01557ec6be01ab80 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019, IRIS-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list o... | 37.461314 | 197 | 0.59643 |
cac007225d9abc8c5a4dbcfe0cb07a87c0e5fc0b | 1,483 | py | Python | events/kawacon2016/migrations/0002_auto_20160127_1922.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | events/kawacon2016/migrations/0002_auto_20160127_1922.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | events/kawacon2016/migrations/0002_auto_20160127_1922.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-27 17:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kawacon2016', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 41.194444 | 490 | 0.598786 |
23065df0f8b6c3e3a37f823111e9e935f975ca7f | 3,294 | py | Python | scrapper.py | yruama42/web_scrapper | 3d626f76f610de1dffacd858137af7bce0c1c4fc | [
"MIT"
] | null | null | null | scrapper.py | yruama42/web_scrapper | 3d626f76f610de1dffacd858137af7bce0c1c4fc | [
"MIT"
] | null | null | null | scrapper.py | yruama42/web_scrapper | 3d626f76f610de1dffacd858137af7bce0c1c4fc | [
"MIT"
] | null | null | null | import os
from urllib.request import urlretrieve
from urllib.request import urlopen
import zipfile
import shutil
from pathlib import Path
from bs4 import BeautifulSoup
import time
def get_href_url_from_url(url, file_extension=None):
page = urlopen(url).read()
soup = BeautifulSoup(page, 'html.parser')
soup... | 29.410714 | 115 | 0.605039 |
d494c77469aef225cb76d599261ac74d3df882ba | 2,574 | py | Python | trees-r-us/binary_tree_and_node.py | NathanielBlairStahn/python-practice | 9f2ed1ab9484df3c46b2ae18286dc51be7590c45 | [
"MIT"
] | null | null | null | trees-r-us/binary_tree_and_node.py | NathanielBlairStahn/python-practice | 9f2ed1ab9484df3c46b2ae18286dc51be7590c45 | [
"MIT"
] | null | null | null | trees-r-us/binary_tree_and_node.py | NathanielBlairStahn/python-practice | 9f2ed1ab9484df3c46b2ae18286dc51be7590c45 | [
"MIT"
] | null | null | null | """
Implements a binary search tree with tree node as a separate "inner" class.
Seems reasonable, but perhaps not the best idea in Python...
"""
class BinaryTreeNode:
def __init__(self, data=None, left=None, right=None):
self.data = data
self.left = left
self.right = right
class BinarySear... | 34.32 | 85 | 0.572261 |
64c04c303b6c5a5fe9f75efc0d6e814971bff3d1 | 3,192 | py | Python | tests/run_configs/test_ecs.py | EmGarr/prefect | 4c764ddb8b121d81857a5954cd70fa7930bcca5a | [
"Apache-2.0"
] | 1 | 2021-03-12T20:05:37.000Z | 2021-03-12T20:05:37.000Z | tests/run_configs/test_ecs.py | EmGarr/prefect | 4c764ddb8b121d81857a5954cd70fa7930bcca5a | [
"Apache-2.0"
] | null | null | null | tests/run_configs/test_ecs.py | EmGarr/prefect | 4c764ddb8b121d81857a5954cd70fa7930bcca5a | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import yaml
from prefect.run_configs import ECSRun
def test_no_args():
config = ECSRun()
assert config.task_definition is None
assert config.task_definition_path is None
assert config.image is None
assert config.env is None
assert config.cpu is None
assert config.... | 29.555556 | 84 | 0.656955 |
73cb05709854e0449145c0683e084a5baaeca161 | 1,910 | py | Python | legacy/cnlp/tests/test_attention.py | ceshine/modern_chinese_nlp | e1d5941f381431ac114f440472d3e0f976437777 | [
"MIT"
] | 42 | 2018-08-21T05:31:18.000Z | 2021-08-30T02:00:05.000Z | legacy/cnlp/tests/test_attention.py | ceshine/modern_chinese_nlp | e1d5941f381431ac114f440472d3e0f976437777 | [
"MIT"
] | null | null | null | legacy/cnlp/tests/test_attention.py | ceshine/modern_chinese_nlp | e1d5941f381431ac114f440472d3e0f976437777 | [
"MIT"
] | 7 | 2018-08-21T09:04:17.000Z | 2021-03-28T06:25:28.000Z | import torch
import pytest
from cnlp.transformer_decoder import Attention, dotdict
class TestAttention:
@classmethod
def setup_class(cls):
cfg = dotdict({
"n_head": 6,
"attn_pdrop": 0,
"resid_pdrop": 0.1,
"afn": "gelu"
})
cls.attn = Atte... | 34.727273 | 77 | 0.542408 |
d7608f705df7f332f18845a46995baef52b5cbf3 | 5,718 | py | Python | code/nlp_self_supervised.py | nzw0301/Understanding-Negative-Samples-in-Instance-Discriminative-Self-supervised-Representation-Learning | 957173bd8ec5b5e00994099d8b4467c74b802303 | [
"MIT"
] | 4 | 2021-10-06T07:04:43.000Z | 2022-01-28T09:31:29.000Z | code/nlp_self_supervised.py | nzw0301/Understanding-Negative-Samples | 957173bd8ec5b5e00994099d8b4467c74b802303 | [
"MIT"
] | null | null | null | code/nlp_self_supervised.py | nzw0301/Understanding-Negative-Samples | 957173bd8ec5b5e00994099d8b4467c74b802303 | [
"MIT"
] | null | null | null | import logging
from pathlib import Path
import hydra
import numpy as np
import torch
from apex.parallel.LARC import LARC
from omegaconf import OmegaConf
from torch.utils.data import DataLoader
from src.data.ag_news import CollateSelfSupervised, get_train_val_datasets
from src.loss import NT_Xent
from src.lr_utils imp... | 34.654545 | 119 | 0.649528 |
2afb6dd90f8cd24f3c1c3d5e4288b6bf5568332e | 1,432 | py | Python | analysis/src/python/evaluation/batching/batch_config.py | eartser/hyperstyle-analyze | 58e2d361662e73e1e047919f57ab840055783b7a | [
"Apache-2.0"
] | 1 | 2022-03-15T09:46:06.000Z | 2022-03-15T09:46:06.000Z | analysis/src/python/evaluation/batching/batch_config.py | eartser/hyperstyle-analyze | 58e2d361662e73e1e047919f57ab840055783b7a | [
"Apache-2.0"
] | 1 | 2022-02-14T13:53:38.000Z | 2022-02-14T13:53:38.000Z | analysis/src/python/evaluation/batching/batch_config.py | eartser/hyperstyle-analyze | 58e2d361662e73e1e047919f57ab840055783b7a | [
"Apache-2.0"
] | 3 | 2022-02-13T16:49:53.000Z | 2022-02-17T13:53:07.000Z | from dataclasses import dataclass
from enum import Enum, unique
from typing import List
from analysis.src.python.evaluation.common.yaml_util import parse_yaml
@unique
class BatchConfigFields(Enum):
PROJECT_PATH = 'project_path'
SCRIPT_PATH = 'script_path'
SCRIPT_ARGS = 'script_args'
SCRIPT_FLAGS = 's... | 36.717949 | 119 | 0.695531 |
a9b894b7e835f66ea870221b41b3797e4b340313 | 7,510 | py | Python | porchlightapi/sources/github.py | cfpb/porchlight | 82457cd6baaefe94a69b9fe6d4fe0601528c6f95 | [
"CC0-1.0"
] | 1 | 2015-07-11T17:52:20.000Z | 2015-07-11T17:52:20.000Z | porchlightapi/sources/github.py | cfpb/porchlight | 82457cd6baaefe94a69b9fe6d4fe0601528c6f95 | [
"CC0-1.0"
] | 34 | 2015-01-26T21:49:39.000Z | 2018-04-02T22:01:36.000Z | porchlightapi/sources/github.py | cfpb/porchlight | 82457cd6baaefe94a69b9fe6d4fe0601528c6f95 | [
"CC0-1.0"
] | 6 | 2015-01-23T18:45:07.000Z | 2021-02-20T10:29:21.000Z | # -*- coding: utf-8 -*-
from urlparse import urlparse, urlunparse
import dateutil.parser
import requests
import re
from porchlightapi.settings import PORCHLIGHT_GITHUB_AUTH
from porchlightapi.settings import PORCHLIGHT_GITHUB_TAG_PATTERN
TAG_PATTERN = re.compile(PORCHLIGHT_GITHUB_TAG_PATTERN)
def github_api_url(pro... | 39.526316 | 90 | 0.689214 |
ebb88e2d4fc0fe4abd5e0ac2839107e815e49b25 | 36 | py | Python | physics/__init__.py | skrolikowski/PyBox | d79c5229df69f21767a4db15ebe05b91bba3dc8d | [
"Unlicense",
"MIT"
] | null | null | null | physics/__init__.py | skrolikowski/PyBox | d79c5229df69f21767a4db15ebe05b91bba3dc8d | [
"Unlicense",
"MIT"
] | null | null | null | physics/__init__.py | skrolikowski/PyBox | d79c5229df69f21767a4db15ebe05b91bba3dc8d | [
"Unlicense",
"MIT"
] | null | null | null | from pybox.physics.aabb import AABB
| 18 | 35 | 0.833333 |
c862b6a83cecb4edc5e63c4c4c72ab69adbd7d8b | 32 | py | Python | conjure-python/src/test/resources/types/expected/with/__init__.py | chewr/conjure-python | ca0ac825f86741c02cd85b1b4ea9456d5786e0ae | [
"Apache-2.0"
] | 10 | 2018-11-21T19:39:54.000Z | 2021-12-16T12:05:02.000Z | conjure-python/src/test/resources/types/expected/with/__init__.py | chewr/conjure-python | ca0ac825f86741c02cd85b1b4ea9456d5786e0ae | [
"Apache-2.0"
] | 61 | 2018-11-25T18:48:01.000Z | 2022-03-30T02:02:35.000Z | conjure-python/src/test/resources/types/expected/with/__init__.py | chewr/conjure-python | ca0ac825f86741c02cd85b1b4ea9456d5786e0ae | [
"Apache-2.0"
] | 10 | 2018-11-21T21:53:43.000Z | 2021-07-29T18:13:38.000Z | # this is package package.with
| 10.666667 | 30 | 0.75 |
87a0c536412d70a019fdcabfb3b8cfe917408cc2 | 4,187 | py | Python | polygon_extraction/json_parser.py | LBNL-ETA/a3dbr | 1dcfeac560e4f859812258cb7021fa664aa35644 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-05T19:00:14.000Z | 2021-09-08T17:03:50.000Z | polygon_extraction/json_parser.py | LBNL-ETA/a3dbr | 1dcfeac560e4f859812258cb7021fa664aa35644 | [
"BSD-3-Clause-LBNL"
] | null | null | null | polygon_extraction/json_parser.py | LBNL-ETA/a3dbr | 1dcfeac560e4f859812258cb7021fa664aa35644 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import json
import polygon_primitives as pp
import utm
from shapely.geometry import Polygon
import numpy as np
#Accepts polygon_coords as a 2D list, and polygon_heights as a 1D array
def save_merged_polygon_geojson(polygon_coords, polygon_hei... | 27.366013 | 117 | 0.674707 |
04930b57498138e1efcdcd56cf3f3102d3bdfb13 | 280 | py | Python | 4-25/10.py | tonyyzy/ProjectEuler | f52de2f931ebd4df2020e32d12062866b1586e72 | [
"MIT"
] | null | null | null | 4-25/10.py | tonyyzy/ProjectEuler | f52de2f931ebd4df2020e32d12062866b1586e72 | [
"MIT"
] | null | null | null | 4-25/10.py | tonyyzy/ProjectEuler | f52de2f931ebd4df2020e32d12062866b1586e72 | [
"MIT"
] | null | null | null | import math
def check_prime(a):
root = math.sqrt(a)
root = math.floor(root)
for i in range(2, root +1):
if a%i == 0:
return False
return True
a = 0
for i in range(2, 2000001):
if check_prime(i) == True:
a += i
print(a) | 20 | 32 | 0.517857 |
6913020260a6435b409d5475330d0403f9ca7fd1 | 1,254 | py | Python | yt_shared/yt_shared/repositories/ytdlp.py | tropicoo/yt-dlp-bot | d9d9b42ced8ef2eede453c659c9272078f8ab2eb | [
"BSD-3-Clause"
] | 2 | 2022-03-10T03:07:23.000Z | 2022-03-22T07:36:16.000Z | yt_shared/yt_shared/repositories/ytdlp.py | tropicoo/yt-dlp-bot | d9d9b42ced8ef2eede453c659c9272078f8ab2eb | [
"BSD-3-Clause"
] | 1 | 2022-03-18T08:03:26.000Z | 2022-03-18T08:03:26.000Z | yt_shared/yt_shared/repositories/ytdlp.py | tropicoo/yt-dlp-bot | d9d9b42ced8ef2eede453c659c9272078f8ab2eb | [
"BSD-3-Clause"
] | null | null | null | import logging
from sqlalchemy import func, select, update
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.exc import MultipleResultsFound
from sqlalchemy.ext.asyncio import AsyncSession
from yt_shared.models import YTDLP
class YtdlpRepository:
def __init__(self) -> None:
self._log = ... | 34.833333 | 80 | 0.645136 |
ed358801ce1f379cfb8a31cee59f1625c5c9aa86 | 41,393 | py | Python | wonkey2/template.py | schlarpc/wonkey2 | b71218a59a43ab272e20c7610d7d9af6ba7dc2f3 | [
"MIT"
] | 1 | 2021-10-05T04:38:51.000Z | 2021-10-05T04:38:51.000Z | wonkey2/template.py | schlarpc/wonkey2 | b71218a59a43ab272e20c7610d7d9af6ba7dc2f3 | [
"MIT"
] | 1 | 2022-02-22T08:22:41.000Z | 2022-02-22T08:22:41.000Z | wonkey2/template.py | schlarpc/wonkey2 | b71218a59a43ab272e20c7610d7d9af6ba7dc2f3 | [
"MIT"
] | null | null | null | import datetime
import hashlib
import inspect
import json
import packmodule
from awacs import acm, cloudformation, logs, route53, s3, sns, sqs, sts
from awacs.aws import Allow, Deny, PolicyDocument, Principal, Statement as _Statement
from troposphere import (
AccountId,
And,
Condition,
Equals,
Find... | 35.5 | 130 | 0.441959 |
6b946eab89887fa83994fa6424f2da10808ab483 | 36,846 | py | Python | onnxruntime/python/onnxruntime_inference_collection.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 669 | 2018-12-03T22:00:31.000Z | 2019-05-06T19:42:49.000Z | onnxruntime/python/onnxruntime_inference_collection.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 440 | 2018-12-03T21:09:56.000Z | 2019-05-06T20:47:23.000Z | onnxruntime/python/onnxruntime_inference_collection.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 140 | 2018-12-03T21:15:28.000Z | 2019-05-06T18:02:36.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
import collections
import collections.abc
import os
import warnings
from... | 39.833514 | 120 | 0.644656 |
b3e52ce5a68286bf55c9bba13130aafca2ff04ce | 254 | py | Python | spider/__init__.py | moonbirdxp/PSpider | 4d7238b4ebafd129ecc5dd1095ce1ece313945ec | [
"BSD-2-Clause"
] | null | null | null | spider/__init__.py | moonbirdxp/PSpider | 4d7238b4ebafd129ecc5dd1095ce1ece313945ec | [
"BSD-2-Clause"
] | null | null | null | spider/__init__.py | moonbirdxp/PSpider | 4d7238b4ebafd129ecc5dd1095ce1ece313945ec | [
"BSD-2-Clause"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
define WebSpider, and also define utilities and instances for web_spider
"""
__version__ = "2.4.1"
from .utilities import *
from .concurrent import TPEnum, WebSpider
from .instances import Fetcher, Parser, Saver, Proxieser
| 21.166667 | 72 | 0.748031 |
33c49907ff39c866bee2f4931bdf842e19ca5edb | 1,336 | py | Python | kriegspiel_api_server/kriegspiel/models/user.py | Kriegspiel/python-api | f25107d5ebc8810af622c66960c153c43a1ffb03 | [
"MIT"
] | 1 | 2016-12-30T10:11:11.000Z | 2016-12-30T10:11:11.000Z | kriegspiel_api_server/kriegspiel/models/user.py | Kriegspiel/python-api | f25107d5ebc8810af622c66960c153c43a1ffb03 | [
"MIT"
] | null | null | null | kriegspiel_api_server/kriegspiel/models/user.py | Kriegspiel/python-api | f25107d5ebc8810af622c66960c153c43a1ffb03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.db import models, transaction
from django.utils import timezone
class UserManager(BaseUserManager):
def _create_user(self, email, username, is_superuser, password=None):
with transaction.atomic():... | 35.157895 | 74 | 0.704341 |
4272875903f6865174baf3a50d6bd47bf99145fd | 5,747 | py | Python | bambi/terms.py | vishalbelsare/bambi | ea27945033f89e3392728a9afc7f0cc89f390e3d | [
"MIT"
] | null | null | null | bambi/terms.py | vishalbelsare/bambi | ea27945033f89e3392728a9afc7f0cc89f390e3d | [
"MIT"
] | null | null | null | bambi/terms.py | vishalbelsare/bambi | ea27945033f89e3392728a9afc7f0cc89f390e3d | [
"MIT"
] | null | null | null | import numpy as np
class ResponseTerm:
"""Representation of a single response model term.
Parameters
----------
term: formulae.ResponseVector
An object describing the response of the model,
as returned by ``formulae.design_matrices().response``
family : Family
An ``Family`... | 37.077419 | 98 | 0.601009 |
a1e8691cd7f25029f199d390f34974c70d486c04 | 4,588 | py | Python | utils/eval.py | SouthMaiya/CSP_Detector | e1a4a7f224f85fa847a99b300a67d3f212d56451 | [
"MIT"
] | 8 | 2019-12-02T07:36:45.000Z | 2021-11-22T14:05:48.000Z | utils/eval.py | SouthMaiya/CSP_Detector | e1a4a7f224f85fa847a99b300a67d3f212d56451 | [
"MIT"
] | 1 | 2020-04-28T06:01:34.000Z | 2020-04-28T06:01:34.000Z | utils/eval.py | SouthMaiya/CSP_Detector | e1a4a7f224f85fa847a99b300a67d3f212d56451 | [
"MIT"
] | 5 | 2019-12-02T08:02:51.000Z | 2021-08-30T07:55:58.000Z | import numpy as np
import torch
from .nms import pth_nms
import ipdb
def compute_overlap(a, b):
"""
Parameters
----------
a: (N, 4) ndarray of float
b: (K, 4) ndarray of float
Returns
-------
overlaps: (N, K) ndarray of overlap between boxes and query_boxes
"""
ar... | 36.412698 | 139 | 0.586748 |
e3944eb76f50d248e078adff259cd5b2a1f8b608 | 4,060 | py | Python | setup_utils.py | msfschaffner/sat-solver | b7587fad865d514067ec90b2900cafaaff4ce2ad | [
"BSD-3-Clause"
] | 27 | 2015-10-13T17:10:48.000Z | 2021-12-17T22:59:52.000Z | setup_utils.py | msfschaffner/sat-solver | b7587fad865d514067ec90b2900cafaaff4ce2ad | [
"BSD-3-Clause"
] | 216 | 2015-05-18T09:17:09.000Z | 2019-10-16T12:39:44.000Z | setup_utils.py | msfschaffner/sat-solver | b7587fad865d514067ec90b2900cafaaff4ce2ad | [
"BSD-3-Clause"
] | 6 | 2015-10-07T16:23:51.000Z | 2020-10-03T03:52:27.000Z | import ast
import os
import re
import subprocess
_R_RC = re.compile("rc(\d+)$")
def parse_version(path):
with open(path) as fp:
return _AssignmentParser().parse(fp.read())["version"]
def write_version_py(filename, major, minor, micro, is_released,
previous_version=None, post_relea... | 26.710526 | 78 | 0.60468 |
26c1fddd3d3395bdec43ad97588370a0f5238cfa | 2,383 | py | Python | src/sentry_sdk/_compat.py | reloadware/reloadium | 5dd5e3eba176baaff00cbc4b64d9aebed8e55a96 | [
"Apache-2.0"
] | 23 | 2022-02-03T07:30:16.000Z | 2022-03-27T19:52:20.000Z | src/sentry_sdk/_compat.py | reloadware/reloadium | 5dd5e3eba176baaff00cbc4b64d9aebed8e55a96 | [
"Apache-2.0"
] | 1 | 2022-03-03T14:41:45.000Z | 2022-03-10T02:09:56.000Z | src/sentry_sdk/_compat.py | reloadware/reloadium | 5dd5e3eba176baaff00cbc4b64d9aebed8e55a96 | [
"Apache-2.0"
] | 1 | 2022-03-22T13:00:25.000Z | 2022-03-22T13:00:25.000Z | import sys
from reloadium.vendored.sentry_sdk._types import MYPY
if MYPY:
from typing import Optional
from typing import Tuple
from typing import Any
from typing import Type
from typing import TypeVar
T = TypeVar("T")
PY2 = sys.version_info[0] == 2
if PY2:
import urlparse # noqa
... | 26.477778 | 95 | 0.589173 |
74eeb65f683991ba40c0a87ad0bb61ee45e61557 | 1,476 | py | Python | source/demodulator.py | JoeCool02/Wireless_Simulator | fcdc431220d46f652c437f6e7bfff20c5dc64740 | [
"MIT"
] | null | null | null | source/demodulator.py | JoeCool02/Wireless_Simulator | fcdc431220d46f652c437f6e7bfff20c5dc64740 | [
"MIT"
] | null | null | null | source/demodulator.py | JoeCool02/Wireless_Simulator | fcdc431220d46f652c437f6e7bfff20c5dc64740 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
File Name: demodulator.py
Author: Joe Peterson
Date: 13 Apr 2008
Purpose: Takes waveform arrays as input and returns their
estimated binary string.
Usage:
from demodulator import *
demodinstance = demodulator()
outputstring = demodinstance.run(inputarray)
period: The symbol period of ... | 27.849057 | 62 | 0.673442 |
d59470aa327e9ea18b3238eb8d885a728db035c9 | 124 | py | Python | dogs/apps.py | shahjalalh/crowdbotics | 21d5407b4db580889903269afb6c236af4349e04 | [
"MIT"
] | null | null | null | dogs/apps.py | shahjalalh/crowdbotics | 21d5407b4db580889903269afb6c236af4349e04 | [
"MIT"
] | null | null | null | dogs/apps.py | shahjalalh/crowdbotics | 21d5407b4db580889903269afb6c236af4349e04 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class DocsConfig(AppConfig):
name = 'dogs'
| 15.5 | 39 | 0.782258 |
5b556450e25d8af4744f9ce79f253e43b32c9843 | 158 | py | Python | poll/education/apps.py | bilbeyt/otokon-workshop | f7025c5d7a10b9b30ff8ab52e0db01a4abb10db8 | [
"MIT"
] | null | null | null | poll/education/apps.py | bilbeyt/otokon-workshop | f7025c5d7a10b9b30ff8ab52e0db01a4abb10db8 | [
"MIT"
] | null | null | null | poll/education/apps.py | bilbeyt/otokon-workshop | f7025c5d7a10b9b30ff8ab52e0db01a4abb10db8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class EducationConfig(AppConfig):
name = 'education'
| 17.555556 | 39 | 0.740506 |
2748c818eeb2e117f7b5cac03d79b8e02606d938 | 8,931 | py | Python | test/browser_testing/features/pages/loan_options.py | OrlandoSoto/owning-a-home | ee1367443079bb7a8397da7e7ea8533a6673c9b7 | [
"CC0-1.0"
] | 95 | 2015-01-15T17:57:02.000Z | 2021-01-05T15:32:50.000Z | test/browser_testing/features/pages/loan_options.py | OrlandoSoto/owning-a-home | ee1367443079bb7a8397da7e7ea8533a6673c9b7 | [
"CC0-1.0"
] | 408 | 2015-01-05T15:17:44.000Z | 2018-03-26T19:44:11.000Z | test/browser_testing/features/pages/loan_options.py | OrlandoSoto/owning-a-home | ee1367443079bb7a8397da7e7ea8533a6673c9b7 | [
"CC0-1.0"
] | 61 | 2015-01-22T21:48:47.000Z | 2021-08-03T12:06:11.000Z | # coding: utf-8
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditi... | 40.780822 | 98 | 0.63789 |
5fa8bcf9ebcea3007e0b0b2b5f1549e13f37a773 | 2,368 | py | Python | .history/mygalleria/views_20201114135623.py | Nyash-Mauro/galleria | 350519827cf86a7af3c334dfedb69c1452e4122a | [
"MIT"
] | null | null | null | .history/mygalleria/views_20201114135623.py | Nyash-Mauro/galleria | 350519827cf86a7af3c334dfedb69c1452e4122a | [
"MIT"
] | null | null | null | .history/mygalleria/views_20201114135623.py | Nyash-Mauro/galleria | 350519827cf86a7af3c334dfedb69c1452e4122a | [
"MIT"
] | null | null | null | from django.shortcuts import render,redirect
from django import forms
from django.http import HttpResponse,Http404,DoesNotExist
import datetime as dt
from cloudinary.forms import cl_init_js_callbacks
from .models import Photo
from .forms import PhotoForm
def upload(request):
context = dict( backend_form = Phot... | 30.358974 | 102 | 0.689189 |
7af9899ef041cd3626714bf27dd443178d0f6755 | 7,677 | py | Python | test/test_player_base.py | ASPP/pelita | 0ceec920aa56af699a2b852272c998f43a2a3566 | [
"BSD-2-Clause"
] | 35 | 2015-01-27T05:49:21.000Z | 2021-12-29T11:38:57.000Z | test/test_player_base.py | ASPP/pelita | 0ceec920aa56af699a2b852272c998f43a2a3566 | [
"BSD-2-Clause"
] | 428 | 2015-01-06T09:09:53.000Z | 2021-10-13T08:33:36.000Z | test/test_player_base.py | ASPP/pelita | 0ceec920aa56af699a2b852272c998f43a2a3566 | [
"BSD-2-Clause"
] | 45 | 2015-02-20T20:15:12.000Z | 2021-08-30T16:41:40.000Z | import pytest
import unittest
import random
import time
from pelita.game import setup_game, run_game, play_turn
from pelita.layout import parse_layout
from pelita.player import (random_player, stopping_player, stepping_player,
round_based_player, speaking_player)
# some directions that ar... | 36.212264 | 96 | 0.529373 |
7dfe05b11d68d3ef23a0d0cd5ccf93abfa3650d6 | 4,638 | py | Python | c-deps/krb5/src/lib/krb5/ccache/t_cccol.py | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-12-03T05:07:39.000Z | 2021-12-03T05:07:39.000Z | c-deps/krb5/src/lib/krb5/ccache/t_cccol.py | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 9 | 2020-05-13T16:28:13.000Z | 2021-12-30T04:07:49.000Z | src/lib/krb5/ccache/t_cccol.py | frozencemetery/krb5 | bb8fa495d00ccd931eec87a01b8920636cf7903e | [
"MIT"
] | 4 | 2020-07-01T12:41:46.000Z | 2022-01-26T03:05:30.000Z | from k5test import *
realm = K5Realm(create_kdb=False)
keyctl = which('keyctl')
out = realm.run([klist, '-c', 'KEYRING:process:abcd'], expected_code=1)
test_keyring = (keyctl is not None and
'Unknown credential cache type' not in out)
if not test_keyring:
skipped('keyring collection tests', 'keyri... | 36.809524 | 76 | 0.658689 |
e47694ea9236cb85e63ecfd1d9c798e6cd9b2ba0 | 145,561 | py | Python | packages/python/plotly/plotly/graph_objs/bar/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | 1 | 2020-04-06T20:57:36.000Z | 2020-04-06T20:57:36.000Z | packages/python/plotly/plotly/graph_objs/bar/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/bar/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# marker
# ------
@property
def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
... | 35.589487 | 87 | 0.5589 |
8c836867ce162491c3292213e9d29742376b629a | 8,668 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.424581 | 206 | 0.671666 |
ea48b0f02a5a072ced7d25e8997d6c7ea86ec35b | 684 | py | Python | tornado/__init__.py | dbravender/tornado | ef65d554a223a54de7e0e88ccea9d6af64e3ae06 | [
"Apache-2.0"
] | 1 | 2018-03-10T22:43:34.000Z | 2018-03-10T22:43:34.000Z | tornado/__init__.py | kzahel/tornado_gen | 7f0bec2a92f7eb78978cdcfacc59e76359deec81 | [
"Apache-2.0"
] | null | null | null | tornado/__init__.py | kzahel/tornado_gen | 7f0bec2a92f7eb78978cdcfacc59e76359deec81 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | 32.571429 | 75 | 0.741228 |
ec9b180849fc64d232398a9482b03de8e994873b | 581 | py | Python | spacy/tests/lang/pl/test_text.py | gandersen101/spaCy | 109849bd311490f17a29b320cb032e43d153f36f | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | spacy/tests/lang/pl/test_text.py | gandersen101/spaCy | 109849bd311490f17a29b320cb032e43d153f36f | [
"MIT"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | spacy/tests/lang/pl/test_text.py | gandersen101/spaCy | 109849bd311490f17a29b320cb032e43d153f36f | [
"MIT"
] | 2 | 2020-02-15T18:33:35.000Z | 2022-02-13T14:11:41.000Z | # coding: utf-8
"""Words like numbers are recognized correctly."""
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize(
"text,match",
[
("10", True),
("1", True),
("10,000", True),
("10,00", True),
("jeden", True),
("dwa", True),
... | 20.034483 | 58 | 0.540448 |
558dad5fd548defdc3ecf1f0bea39d3545d9b3ff | 12,863 | py | Python | TwitterBot/BaseBot.py | shogo82148/JO_RI_bot | 653008faf8356a6c6e2b44f0154f646774aff79b | [
"MIT"
] | null | null | null | TwitterBot/BaseBot.py | shogo82148/JO_RI_bot | 653008faf8356a6c6e2b44f0154f646774aff79b | [
"MIT"
] | null | null | null | TwitterBot/BaseBot.py | shogo82148/JO_RI_bot | 653008faf8356a6c6e2b44f0154f646774aff79b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import tweepy
import tweepy.binder
import tweepywrap
import time
import httplib
import re
import codecs
import sys
import datetime
import crondaemon
import logging
import logging.handlers
from multiprocessing import Process, Lock, Queue
import traceback
from TwitterStream i... | 32.73028 | 115 | 0.546684 |
e8be5e41a770424661eb339488c08367fb4acd8d | 5,126 | py | Python | evennia/accounts/manager.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | null | null | null | evennia/accounts/manager.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | null | null | null | evennia/accounts/manager.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | null | null | null | """
The managers for the custom Account object and permissions.
"""
import datetime
from django.utils import timezone
from django.contrib.auth.models import UserManager
from evennia.typeclasses.managers import (TypedObjectManager, TypeclassManager)
__all__ = ("AccountManager",)
#
# Account Manager
#
class AccountDB... | 28.320442 | 81 | 0.615099 |
7c8b2c8df9656f4c185e18c70fb04c8907d8dd51 | 3,764 | py | Python | cfgov/scripts/export_enforcement_actions.py | forumone/consumerfinance.gov | 525a7bd5d44cf70904b73d752950e6e0de5e4329 | [
"CC0-1.0"
] | 4 | 2020-03-19T19:32:26.000Z | 2020-06-30T11:15:00.000Z | cfgov/scripts/export_enforcement_actions.py | forumone/consumerfinance.gov | 525a7bd5d44cf70904b73d752950e6e0de5e4329 | [
"CC0-1.0"
] | 100 | 2020-02-06T13:32:37.000Z | 2020-08-19T15:02:02.000Z | cfgov/scripts/export_enforcement_actions.py | raft-tech/cfgov-refresh | 7c63c31fd6bb95ed4f7d368f1e1252175f0c71ca | [
"CC0-1.0"
] | null | null | null | import csv
import datetime
import html
import re
from django.http import HttpResponse
from django.utils import html as html_util
from v1.models.learn_page import EnforcementActionPage
from v1.util.migrations import get_stream_data
HEADINGS = [
'Matter name',
'Date filed',
'URL',
'Status',
'Categ... | 33.90991 | 79 | 0.601753 |
400582d70154e2344f42c741c427ab3bc7530730 | 1,609 | py | Python | server/server.py | tiankaixie/fairrankvis | 6810895cae280ffb1caa790414f754f34d8bbb8b | [
"MIT"
] | 1 | 2022-03-01T05:32:17.000Z | 2022-03-01T05:32:17.000Z | server/server.py | VADERASU/fairrankvis | 52aabf2b94344072cf8e58c09424e09da4fe321e | [
"MIT"
] | null | null | null | server/server.py | VADERASU/fairrankvis | 52aabf2b94344072cf8e58c09424e09da4fe321e | [
"MIT"
] | 2 | 2021-10-01T01:51:20.000Z | 2021-11-13T18:58:36.000Z | from flask import Flask, escape, request, json, jsonify
import networkx as nx
app = Flask(__name__)
# test route
@app.route('/')
def hello():
"""Just a test api
Returns:
String -- returned html
"""
name = request.args.get("name", "World")
return f'Hello, {escape(name)}!'
@app.route('/t... | 26.377049 | 152 | 0.576134 |
06edcddf4a00e7f7e04403a66f521cce8ba43d68 | 2,604 | bzl | Python | tools/defaults.bzl | soniaai/rules_nodejs | 27dcfa0cf365497984c21951ec80a73e9d5d7471 | [
"Apache-2.0"
] | null | null | null | tools/defaults.bzl | soniaai/rules_nodejs | 27dcfa0cf365497984c21951ec80a73e9d5d7471 | [
"Apache-2.0"
] | null | null | null | tools/defaults.bzl | soniaai/rules_nodejs | 27dcfa0cf365497984c21951ec80a73e9d5d7471 | [
"Apache-2.0"
] | null | null | null | """Wrappers around build rules
These set common default attributes and behaviors for our local repo
"""
load(
"@build_bazel_rules_nodejs//:index.bzl",
_COMMON_REPLACEMENTS = "COMMON_REPLACEMENTS",
_nodejs_test = "nodejs_test",
_pkg_npm = "pkg_npm",
)
load("@rules_codeowners//tools:codeowners.bzl", _co... | 30.27907 | 147 | 0.630184 |
90723ff8fc2070cc65d6901dc179ba114c9ad514 | 1,876 | py | Python | src/09-built-on-asyncio/the_trio/prod_trio.py | Joeriksson/async-techniques-python-course | 7a4ca2ecb92f1e58c1c454720e0fde0f01c92061 | [
"MIT"
] | 380 | 2018-09-26T17:40:52.000Z | 2022-03-29T02:38:17.000Z | src/09-built-on-asyncio/the_trio/prod_trio.py | Joeriksson/async-techniques-python-course | 7a4ca2ecb92f1e58c1c454720e0fde0f01c92061 | [
"MIT"
] | 13 | 2018-09-30T05:55:40.000Z | 2022-01-24T20:40:09.000Z | src/09-built-on-asyncio/the_trio/prod_trio.py | Joeriksson/async-techniques-python-course | 7a4ca2ecb92f1e58c1c454720e0fde0f01c92061 | [
"MIT"
] | 214 | 2018-09-26T18:53:17.000Z | 2021-12-30T16:58:27.000Z | import datetime
import colorama
import random
import trio
async def main():
t0 = datetime.datetime.now()
print(colorama.Fore.WHITE + "App started.", flush=True)
"""
trio.Queue was removed in v0.11.0:
- Replacing the call to trio.Queue() by trio.open_memory_channel()
- Using a MemorySendChanne... | 31.79661 | 82 | 0.647655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.