hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7271ea3544f50197b3f61177d0ffc065eca8731 | 9,227 | py | Python | deep_learning.py | ice-blaze/simple-captcha-deeplearning | 16960249bf316bef8fe6b9d86113c902309b36c5 | [
"MIT"
] | 2 | 2018-02-20T14:41:59.000Z | 2018-03-02T20:52:26.000Z | deep_learning.py | ice-blaze/simple-captcha-deeplearning | 16960249bf316bef8fe6b9d86113c902309b36c5 | [
"MIT"
] | null | null | null | deep_learning.py | ice-blaze/simple-captcha-deeplearning | 16960249bf316bef8fe6b9d86113c902309b36c5 | [
"MIT"
] | null | null | null | from generate_captchas import CHAR_POSSIBILITIES
from generate_captchas import generate_captcha
from generate_captchas import get_random_captcha_names_and_lines
from digital_processing_image_approach import clean_image_kernel4
import keras
from keras.models import Sequential, load_model
from keras.layers import Dense, ... | 30.452145 | 79 | 0.645605 | from generate_captchas import CHAR_POSSIBILITIES
from generate_captchas import generate_captcha
from generate_captchas import get_random_captcha_names_and_lines
from digital_processing_image_approach import clean_image_kernel4
import keras
from keras.models import Sequential, load_model
from keras.layers import Dense, ... | true | true |
f7271f75be46e1387690682014cc916246b65748 | 8,007 | py | Python | pepper_variant/modules/python/models/predict_distributed_cpu.py | Samteymoori/pepper | 734d226de47a855952e3b58145c1fcfbe221d3b4 | [
"MIT"
] | null | null | null | pepper_variant/modules/python/models/predict_distributed_cpu.py | Samteymoori/pepper | 734d226de47a855952e3b58145c1fcfbe221d3b4 | [
"MIT"
] | null | null | null | pepper_variant/modules/python/models/predict_distributed_cpu.py | Samteymoori/pepper | 734d226de47a855952e3b58145c1fcfbe221d3b4 | [
"MIT"
] | null | null | null | import sys
import os
import torch
import torch.onnx
import torch.distributed as dist
import torch.nn as nn
import onnxruntime
from datetime import datetime
from torch.utils.data import DataLoader
import torch.multiprocessing as mp
from pepper_variant.modules.python.models.dataloader_predict import SequenceDataset
from... | 47.378698 | 123 | 0.608842 | import sys
import os
import torch
import torch.onnx
import torch.distributed as dist
import torch.nn as nn
import onnxruntime
from datetime import datetime
from torch.utils.data import DataLoader
import torch.multiprocessing as mp
from pepper_variant.modules.python.models.dataloader_predict import SequenceDataset
from... | true | true |
f7271f7b24dfad40337af89fa46c4ae330c1b315 | 2,394 | py | Python | neuroballad/neuroballad_execute.py | KathyFeiyang/Neuroballad | e02506f81a2af4125b58b34849135ef8eead314c | [
"BSD-3-Clause"
] | null | null | null | neuroballad/neuroballad_execute.py | KathyFeiyang/Neuroballad | e02506f81a2af4125b58b34849135ef8eead314c | [
"BSD-3-Clause"
] | null | null | null | neuroballad/neuroballad_execute.py | KathyFeiyang/Neuroballad | e02506f81a2af4125b58b34849135ef8eead314c | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import h5py
import networkx as nx
import argparse
import itertools
import random
import pickle
import neurokernel.mpi_relaunch
import neurokernel.core_gpu as core
from neurokernel.LPU.InputProcessors.StepInputProcessor import StepInputProcessor
from neurokernel.LPU.InputProcessors.FileInputProcesso... | 36.272727 | 112 | 0.724728 | import numpy as np
import h5py
import networkx as nx
import argparse
import itertools
import random
import pickle
import neurokernel.mpi_relaunch
import neurokernel.core_gpu as core
from neurokernel.LPU.InputProcessors.StepInputProcessor import StepInputProcessor
from neurokernel.LPU.InputProcessors.FileInputProcesso... | true | true |
f7272096c7c7419d953f812ee3f5ff9bf5aca83f | 674 | py | Python | apis/task/serializers.py | computablelabs/capi | 44e349fa3c71c8d2d390cdf2a5b7b8892807b40a | [
"MIT"
] | null | null | null | apis/task/serializers.py | computablelabs/capi | 44e349fa3c71c8d2d390cdf2a5b7b8892807b40a | [
"MIT"
] | 43 | 2019-09-03T14:50:23.000Z | 2019-12-18T17:30:11.000Z | apis/task/serializers.py | computablelabs/capi | 44e349fa3c71c8d2d390cdf2a5b7b8892807b40a | [
"MIT"
] | 1 | 2019-10-15T14:41:28.000Z | 2019-10-15T14:41:28.000Z | from flask_restplus import Model, fields
NewTaskResult = Model('NewTaskResult', {
'message': fields.String(required=True, description='Server response when an anyschronous task is created'),
'task_id': fields.String(required=True, description='UUID of the created asynchronous task')
})
TaskResult = Model(... | 51.846154 | 114 | 0.743323 | from flask_restplus import Model, fields
NewTaskResult = Model('NewTaskResult', {
'message': fields.String(required=True, description='Server response when an anyschronous task is created'),
'task_id': fields.String(required=True, description='UUID of the created asynchronous task')
})
TaskResult = Model(... | true | true |
f727210386943796d9c7b108e0c2ae73b4a71275 | 1,325 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/diagnostics_profile.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/diagnostics_profile.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/diagnostics_profile.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 38.970588 | 82 | 0.640755 |
from msrest.serialization import Model
class DiagnosticsProfile(Model):
_attribute_map = {
'boot_diagnostics': {'key': 'bootDiagnostics', 'type': 'BootDiagnostics'},
}
def __init__(self, **kwargs):
super(DiagnosticsProfile, self).__init__(**kwargs)
self.boot_diagnostic... | true | true |
f7272115b89aaed7d8a829a174cfd5a6199d6efc | 2,425 | py | Python | 19th/ads-insert/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | 19th/ads-insert/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | 19th/ads-insert/solution.py | WooJin1993/coding_test | ec9dc2dc768fe45700b4c0695b16535c0a824f6e | [
"MIT"
] | null | null | null | # 문제: https://programmers.co.kr/learn/courses/30/lessons/72414
# --- 첫 풀이 ---
# 31개 테스트 케이스 중 시간초과 18개
from bisect import bisect_left, bisect_right
def solution(play_time, adv_time, logs):
adv_time = 3600*int(adv_time[:2]) + 60*int(adv_time[3:5]) + int(adv_time[6:])
starts, ends = [], []
for log in ... | 31.493506 | 81 | 0.547216 |
from bisect import bisect_left, bisect_right
def solution(play_time, adv_time, logs):
adv_time = 3600*int(adv_time[:2]) + 60*int(adv_time[3:5]) + int(adv_time[6:])
starts, ends = [], []
for log in logs:
start, end = log.split("-")
start = 3600*int(start[:2]) + 60*int(start[3:5]) +... | true | true |
f72721e58066887b759506095186097135e7d354 | 379,524 | py | Python | Data/scigrid-de/pypower/scigrid_2011_01_07_01.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | Data/scigrid-de/pypower/scigrid_2011_01_07_01.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | Data/scigrid-de/pypower/scigrid_2011_01_07_01.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | from numpy import array
def scigrid_2011_01_07_01():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ],
[589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ],
[590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,... | 71.018713 | 137 | 0.464687 | from numpy import array
def scigrid_2011_01_07_01():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ],
[589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ],
[590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,... | true | true |
f727228b9cd69dec7cd34e56d40507b2d808473f | 2,667 | py | Python | src/assignments/Assignment13/win.py | acc-cosc-1336/cosc-1336-spring-2018-Skynet2020 | bfa9a4cb98ec33aee5b1c2a4277f66851c703335 | [
"MIT"
] | null | null | null | src/assignments/Assignment13/win.py | acc-cosc-1336/cosc-1336-spring-2018-Skynet2020 | bfa9a4cb98ec33aee5b1c2a4277f66851c703335 | [
"MIT"
] | 4 | 2018-02-02T13:51:49.000Z | 2018-04-01T03:07:58.000Z | src/assignments/Assignment13/win.py | acc-cosc-1336/cosc-1336-spring-2018-Skynet2020 | bfa9a4cb98ec33aee5b1c2a4277f66851c703335 | [
"MIT"
] | null | null | null | from tkinter import Tk, IntVar, Checkbutton, Button, Label, StringVar
from evaluator import Evaluator
#src.assignments.assignment13.
class Win(Tk):
def __init__(self):
Tk.__init__(self, None, None)
self.wm_title('My first window')
self.evaluator = Evaluator()
self.label_var = Stri... | 39.220588 | 112 | 0.661417 | from tkinter import Tk, IntVar, Checkbutton, Button, Label, StringVar
from evaluator import Evaluator
class Win(Tk):
def __init__(self):
Tk.__init__(self, None, None)
self.wm_title('My first window')
self.evaluator = Evaluator()
self.label_var = StringVar()
Label(self, te... | true | true |
f7272317299c91b38f7773508e076da242b481f9 | 10,657 | py | Python | tensorflow_probability/python/mcmc/transformed_kernel_test.py | oahziur/probability | 11645be43d2845da65a4fbafde4cfa95780280c0 | [
"Apache-2.0"
] | 1 | 2019-01-09T19:51:29.000Z | 2019-01-09T19:51:29.000Z | tensorflow_probability/python/mcmc/transformed_kernel_test.py | oahziur/probability | 11645be43d2845da65a4fbafde4cfa95780280c0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/mcmc/transformed_kernel_test.py | oahziur/probability | 11645be43d2845da65a4fbafde4cfa95780280c0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability 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 o... | 36.496575 | 80 | 0.63836 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
tfd = tfp.distributions
tfb = tfp.bijectors
FakeInnerKernelResults = collections.namedtupl... | true | true |
f727232d55060b38548b3df09955ef9d66976e61 | 1,988 | py | Python | test_for_daysBetweenDates.py | serglit72/Python_exercises | 7de440a3bdf50c4162bb2df5250487d568942ca8 | [
"Apache-2.0"
] | null | null | null | test_for_daysBetweenDates.py | serglit72/Python_exercises | 7de440a3bdf50c4162bb2df5250487d568942ca8 | [
"Apache-2.0"
] | null | null | null | test_for_daysBetweenDates.py | serglit72/Python_exercises | 7de440a3bdf50c4162bb2df5250487d568942ca8 | [
"Apache-2.0"
] | null | null | null | def nextDay(year, month, day):
"""Simple version: assume every month has 30 days"""
if day < 30:
return year, month, day + 1
else:
if month == 12:
return year + 1, 1, 1
else:
return year, month + 1, 1
def dateIsBefore(year1, month1, day1, year2, month... | 33.694915 | 115 | 0.560865 | def nextDay(year, month, day):
if day < 30:
return year, month, day + 1
else:
if month == 12:
return year + 1, 1, 1
else:
return year, month + 1, 1
def dateIsBefore(year1, month1, day1, year2, month2, day2):
if year1 < year2:
return True
i... | true | true |
f72723395930ff9f16f58ae6aa2edef6800a2bf5 | 16,970 | py | Python | intake/tests/services/test_submissions.py | cforlando/intake | a5233d5c0f862f28ee265b9b4831405aabeec7e2 | [
"MIT"
] | null | null | null | intake/tests/services/test_submissions.py | cforlando/intake | a5233d5c0f862f28ee265b9b4831405aabeec7e2 | [
"MIT"
] | null | null | null | intake/tests/services/test_submissions.py | cforlando/intake | a5233d5c0f862f28ee265b9b4831405aabeec7e2 | [
"MIT"
] | 1 | 2020-02-05T01:11:45.000Z | 2020-02-05T01:11:45.000Z | import logging
from unittest.mock import Mock, patch
from django.test import TestCase
import intake.services.submissions as SubmissionsService
from intake.tests import mock, factories
from intake.tests.mock_org_answers import get_answers_for_orgs
from intake.tests.base_testcases import ExternalNotificationsPatchTestCas... | 39.55711 | 79 | 0.668592 | import logging
from unittest.mock import Mock, patch
from django.test import TestCase
import intake.services.submissions as SubmissionsService
from intake.tests import mock, factories
from intake.tests.mock_org_answers import get_answers_for_orgs
from intake.tests.base_testcases import ExternalNotificationsPatchTestCas... | true | true |
f727240f97e54b1fa0c0d75687b19d2e132d762b | 1,245 | py | Python | restaurant/urls.py | ugleiton/Restaurant-Website | 63473bf1e27ee71c082d1065fcb3ea949ec95da1 | [
"MIT"
] | null | null | null | restaurant/urls.py | ugleiton/Restaurant-Website | 63473bf1e27ee71c082d1065fcb3ea949ec95da1 | [
"MIT"
] | null | null | null | restaurant/urls.py | ugleiton/Restaurant-Website | 63473bf1e27ee71c082d1065fcb3ea949ec95da1 | [
"MIT"
] | null | null | null | """restaurant URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 40.16129 | 78 | 0.724498 | from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from index.views import home, about
from contact.views import contact
urlpatterns = [
path('', home, name="home"),
path('about/', about, name="about"),
path('co... | true | true |
f727248befee3dfa1776794c2e1e23214fd8cac8 | 262 | py | Python | finmeter/sentiment/__init__.py | mikahama/FinMeter | fd1d3d8feb216e6247a1eeac3bac16a9dd235e66 | [
"Apache-2.0"
] | 5 | 2019-10-06T20:13:32.000Z | 2021-11-07T14:27:02.000Z | finmeter/sentiment/__init__.py | mikahama/FinMeter | fd1d3d8feb216e6247a1eeac3bac16a9dd235e66 | [
"Apache-2.0"
] | null | null | null | finmeter/sentiment/__init__.py | mikahama/FinMeter | fd1d3d8feb216e6247a1eeac3bac16a9dd235e66 | [
"Apache-2.0"
] | null | null | null | from .predict_sentiment import predict as _predict
def predict(sentence):
r = _predict([sentence])[0]
if r == 0:
#positive
return 1
elif r == 1:
#strongly positive
return 2
elif r == 2:
#negative
return -1
else:
#strongly negative
return -2 | 16.375 | 50 | 0.671756 | from .predict_sentiment import predict as _predict
def predict(sentence):
r = _predict([sentence])[0]
if r == 0:
return 1
elif r == 1:
return 2
elif r == 2:
return -1
else:
return -2 | true | true |
f72726193d6a6874ed012cc02ed9030e36debec2 | 84,269 | py | Python | tests/fields/test_fields.py | SolarTech/mongoengine | 772096ec55963fc6b079b84ccac2a9917deb9204 | [
"MIT"
] | null | null | null | tests/fields/test_fields.py | SolarTech/mongoengine | 772096ec55963fc6b079b84ccac2a9917deb9204 | [
"MIT"
] | null | null | null | tests/fields/test_fields.py | SolarTech/mongoengine | 772096ec55963fc6b079b84ccac2a9917deb9204 | [
"MIT"
] | null | null | null | import datetime
import unittest
from bson import DBRef, ObjectId, SON
import pytest
from mongoengine import (
BooleanField,
ComplexDateTimeField,
DateField,
DateTimeField,
DictField,
Document,
DoesNotExist,
DynamicDocument,
DynamicField,
EmbeddedDocument,
EmbeddedDocumentFi... | 31.303492 | 116 | 0.585008 | import datetime
import unittest
from bson import DBRef, ObjectId, SON
import pytest
from mongoengine import (
BooleanField,
ComplexDateTimeField,
DateField,
DateTimeField,
DictField,
Document,
DoesNotExist,
DynamicDocument,
DynamicField,
EmbeddedDocument,
EmbeddedDocumentFi... | true | true |
f72726b689c5695dc442b20557b929ef70c44146 | 9,818 | py | Python | la_funding_analysis/pipeline/cleaning.py | nestauk/la_funding_analysis | bc338583817174f47f2cff2105f4a20a89df4c99 | [
"MIT"
] | null | null | null | la_funding_analysis/pipeline/cleaning.py | nestauk/la_funding_analysis | bc338583817174f47f2cff2105f4a20a89df4c99 | [
"MIT"
] | 1 | 2021-06-24T13:45:14.000Z | 2021-06-24T13:45:14.000Z | la_funding_analysis/pipeline/cleaning.py | nestauk/la_decarb_funding_analysis | bc338583817174f47f2cff2105f4a20a89df4c99 | [
"MIT"
] | 1 | 2021-07-19T11:54:24.000Z | 2021-07-19T11:54:24.000Z | # File: pipeline/cleaning.py
"""Functions to clean datasets.
Calling each function returns a clean version of the associated dataset.
"""
import numpy as np
import pandas as pd
from la_funding_analysis.getters.local_authority_data import (
get_epc,
get_grants,
get_imd,
get_old_parties,
get_parties... | 36.095588 | 91 | 0.637401 |
import numpy as np
import pandas as pd
from la_funding_analysis.getters.local_authority_data import (
get_epc,
get_grants,
get_imd,
get_old_parties,
get_parties_models,
get_fuel_poverty,
)
from la_funding_analysis.utils.name_cleaners import (
clean_names,
model_type,
strip_and_tit... | true | true |
f72726ceb124706a8c674c54488644e60cd85184 | 3,806 | py | Python | test/validation/test_request_history.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 150 | 2016-10-05T11:09:36.000Z | 2022-03-06T16:24:41.000Z | test/validation/test_request_history.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 27 | 2017-03-02T03:37:02.000Z | 2022-02-10T04:59:54.000Z | test/validation/test_request_history.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 21 | 2016-11-11T07:51:48.000Z | 2020-04-26T21:38:33.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 38.06 | 77 | 0.696532 |
from test.base import BaseTest
from activitystreams import parse as as_parser
from dino.validation import request
class RequestHistoryTest(BaseTest):
def setUp(self):
super(RequestHistoryTest, self).setUp()
self.create_channel_and_room()
def test_history(self):
act = sel... | true | true |
f72728291b1f65b40e3ca725885ed1fbb1420452 | 4,483 | py | Python | federated_learning_without_transfer_learning/ntf_client_fit_model.py | HwangDongJun/Federated_Learning_using_Websockets | 87c2873ae9b6a651750d08f4cd0ad5757893ce88 | [
"MIT"
] | 2 | 2021-01-05T09:41:09.000Z | 2022-02-04T04:38:50.000Z | federated_learning_without_transfer_learning/ntf_client_fit_model.py | HwangDongJun/Federated_Learning_using_Websockets | 87c2873ae9b6a651750d08f4cd0ad5757893ce88 | [
"MIT"
] | null | null | null | federated_learning_without_transfer_learning/ntf_client_fit_model.py | HwangDongJun/Federated_Learning_using_Websockets | 87c2873ae9b6a651750d08f4cd0ad5757893ce88 | [
"MIT"
] | null | null | null | # Setup library
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import numpy as np
import PIL.Image as Image
from PIL import ImageFile
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.keras import layers
import matplotlib.pylab as plt
import efficientnet... | 30.496599 | 86 | 0.741914 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import numpy as np
import PIL.Image as Image
from PIL import ImageFile
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.keras import layers
import matplotlib.pylab as plt
import efficientnet.tfkeras as efn... | true | true |
f7272b3ab2b9841850357f84b5ad356ecf40ce88 | 967 | py | Python | python/src/queues/linked_queue_improved.py | marioluan/abstract-data-types | f3823fc4649c86f5a9b677e97e8a8706e5340405 | [
"MIT"
] | 5 | 2017-03-17T17:00:00.000Z | 2018-01-27T12:31:37.000Z | python/src/queues/linked_queue_improved.py | marioluan/abstract-data-types | f3823fc4649c86f5a9b677e97e8a8706e5340405 | [
"MIT"
] | 2 | 2016-08-16T17:02:57.000Z | 2016-08-28T03:34:31.000Z | python/src/queues/linked_queue_improved.py | marioluan/abstract-data-types | f3823fc4649c86f5a9b677e97e8a8706e5340405 | [
"MIT"
] | 1 | 2020-05-19T13:30:19.000Z | 2020-05-19T13:30:19.000Z | from queue_interface import QueueInterface
from src.list.node import Node
class LinkedQueueImproved(QueueInterface):
""" implementation of a queue using a linked list """
def __init__(self):
""" create an empty queue """
self.length = 0
self.head = None
self.tail = None
def isEmpty(self):
"... | 25.447368 | 68 | 0.620476 | from queue_interface import QueueInterface
from src.list.node import Node
class LinkedQueueImproved(QueueInterface):
def __init__(self):
self.length = 0
self.head = None
self.tail = None
def isEmpty(self):
return (self.length == 0)
def insert(self, cargo):
node = Node(cargo)
node.next ... | true | true |
f7272babaf32e6372e7957c59ee51b846979c0a3 | 12,854 | py | Python | representation_batch_rl/representation_batch_rl/cql_pixels.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | representation_batch_rl/representation_batch_rl/cql_pixels.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | representation_batch_rl/representation_batch_rl/cql_pixels.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 35.410468 | 143 | 0.658316 |
import typing
from dm_env import specs as dm_env_specs
import numpy as np
import tensorflow as tf
from tf_agents.specs.tensor_spec import TensorSpec
from representation_batch_rl.batch_rl import critic
from representation_batch_rl.batch_rl.encoders import ConvStack
from representation_batch_rl.batch_rl... | true | true |
f7272c0f0357147e933343d529e0daf7bf5c0052 | 872 | py | Python | src/test/test_duplicate_registration.py | FlyrInc/alembic_utils | a63465da1bd91eed86e28d65334e168ab9a2bfb6 | [
"MIT"
] | null | null | null | src/test/test_duplicate_registration.py | FlyrInc/alembic_utils | a63465da1bd91eed86e28d65334e168ab9a2bfb6 | [
"MIT"
] | null | null | null | src/test/test_duplicate_registration.py | FlyrInc/alembic_utils | a63465da1bd91eed86e28d65334e168ab9a2bfb6 | [
"MIT"
] | null | null | null | from alembic_utils.pg_function import PGFunction
from alembic_utils.replaceable_entity import register_entities, registry
from alembic_utils.testbase import run_alembic_command
def to_upper():
return PGFunction(
schema="public",
signature="to_upper(some_text text)",
definition="""
... | 27.25 | 81 | 0.666284 | from alembic_utils.pg_function import PGFunction
from alembic_utils.replaceable_entity import register_entities, registry
from alembic_utils.testbase import run_alembic_command
def to_upper():
return PGFunction(
schema="public",
signature="to_upper(some_text text)",
definition="""
... | true | true |
f7272cffc5cbad32c974f28fc7ed2fe66f62b9fc | 13,112 | py | Python | cochlear/noise_exposure.py | bburan/cochlear | 1e7ea32730a794b9f6936440a32e4a82c4bf73e7 | [
"BSD-3-Clause"
] | null | null | null | cochlear/noise_exposure.py | bburan/cochlear | 1e7ea32730a794b9f6936440a32e4a82c4bf73e7 | [
"BSD-3-Clause"
] | null | null | null | cochlear/noise_exposure.py | bburan/cochlear | 1e7ea32730a794b9f6936440a32e4a82c4bf73e7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
import logging
log = logging.getLogger(__name__)
import numpy as np
from scipy import signal
from traits.api import Instance, Float, Property, Int
from traitsui.api import (View, Item, ToolBar, Action, ActionGroup, VGroup,
HSplit, MenuBar, Menu, HGroup)
from ... | 35.630435 | 80 | 0.583359 | from __future__ import division
import logging
log = logging.getLogger(__name__)
import numpy as np
from scipy import signal
from traits.api import Instance, Float, Property, Int
from traitsui.api import (View, Item, ToolBar, Action, ActionGroup, VGroup,
HSplit, MenuBar, Menu, HGroup)
from ... | true | true |
f7272d6bde17f58aecbdc1140fbcccd1817e75c6 | 3,313 | py | Python | contrib/cmap.py | visinf/deblur-devil | 53cc4c72a4ddb9dcede5ee52dc53000c39ff5dab | [
"Apache-2.0"
] | 18 | 2019-11-02T05:45:48.000Z | 2021-09-12T10:03:08.000Z | contrib/cmap.py | visinf/deblur-devil | 53cc4c72a4ddb9dcede5ee52dc53000c39ff5dab | [
"Apache-2.0"
] | 3 | 2019-12-10T07:52:24.000Z | 2021-04-07T19:14:31.000Z | contrib/cmap.py | visinf/deblur-devil | 53cc4c72a4ddb9dcede5ee52dc53000c39ff5dab | [
"Apache-2.0"
] | 3 | 2020-05-26T08:02:05.000Z | 2020-09-26T21:25:10.000Z | # Author: Jochen Gast <jochen.gast@visinf.tu-darmstadt.de>
import numpy as np
import torch
from matplotlib import cm
from torch import nn
# ----------------------------------------------------------------------------------------
# See https://matplotlib.org/examples/color/colormaps_reference.html
#
# Typical choices ... | 36.01087 | 99 | 0.563236 |
import numpy as np
import torch
from matplotlib import cm
from torch import nn
# ----------------------------------------------------------------------------------------
COLORMAPS = [
# Perceptually Uniform Sequential
'viridis', 'plasma', 'inferno', 'magma',
# Sequential
'Greys', 'Purples', 'B... | true | true |
f7272f2c05e0fbb0337367a91ca3012dfcefc44e | 7,426 | py | Python | release.py | euri10/opentelemetry-operations-python | d751953dc30d6d0b27dbf605e9b505c283d00cb2 | [
"Apache-2.0"
] | null | null | null | release.py | euri10/opentelemetry-operations-python | d751953dc30d6d0b27dbf605e9b505c283d00cb2 | [
"Apache-2.0"
] | null | null | null | release.py | euri10/opentelemetry-operations-python | d751953dc30d6d0b27dbf605e9b505c283d00cb2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import re
import subprocess
import sys
from datetime import datetime
from pathlib import Path
from typing import Dict, Iterable, Sequence, Union
RELEASE_COMMIT_FMT = """Release {release_version} (Part 1/2) release commit
- Update version.py files
- Marked releases in changelogs... | 28.452107 | 99 | 0.62564 |
import argparse
import re
import subprocess
import sys
from datetime import datetime
from pathlib import Path
from typing import Dict, Iterable, Sequence, Union
RELEASE_COMMIT_FMT = """Release {release_version} (Part 1/2) release commit
- Update version.py files
- Marked releases in changelogs
- Pinned `opentelemet... | true | true |
f7272fca640e6f007ec6f1e2a9189cc37e27b8ba | 5,026 | py | Python | pgAdmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/test_indexes_get.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/test_indexes_get.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/tests/test_indexes_get.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import uuid
from ... | 47.415094 | 79 | 0.547951 | true | true | |
f72730970d6aae9560fb47022aa4c2e36ccd3f51 | 2,001 | py | Python | api/serializers.py | Vadim3x4/yamdb_final | d6ccca74a41c5d0a78977d71b446daf2420fa8bf | [
"MIT"
] | null | null | null | api/serializers.py | Vadim3x4/yamdb_final | d6ccca74a41c5d0a78977d71b446daf2420fa8bf | [
"MIT"
] | null | null | null | api/serializers.py | Vadim3x4/yamdb_final | d6ccca74a41c5d0a78977d71b446daf2420fa8bf | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from rest_framework import serializers
from .models import Category, Comment, Genre, Review, Title
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
fields = (
"name",
"slug",
)
clas... | 23.821429 | 75 | 0.625187 | from django.shortcuts import get_object_or_404
from rest_framework import serializers
from .models import Category, Comment, Genre, Review, Title
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
fields = (
"name",
"slug",
)
clas... | true | true |
f72730c032f7ff966ee6845ddca77d3b6280e9b8 | 10,719 | py | Python | optimization/main/federated_trainer.py | alshedivat/federated | 100f0e0940282818c42c39156407ae419f26de50 | [
"Apache-2.0"
] | 2 | 2021-10-19T13:55:11.000Z | 2021-11-11T11:26:05.000Z | federated/optimization/main/federated_trainer.py | luke-who/TFF | fe9f44a504bc51b603a3ab9a181148da0aa9612f | [
"MIT"
] | null | null | null | federated/optimization/main/federated_trainer.py | luke-who/TFF | fe9f44a504bc51b603a3ab9a181148da0aa9612f | [
"MIT"
] | 1 | 2021-03-09T09:48:56.000Z | 2021-03-09T09:48:56.000Z | # Copyright 2020, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 41.546512 | 80 | 0.746525 |
import collections
import os.path
from typing import Callable
from absl import app
from absl import flags
import tensorflow as tf
import tensorflow_federated as tff
from optimization.cifar100 import federated_cifar100
from optimization.emnist import federated_emnist
from optimization.emnist_ae import fe... | true | true |
f7273144dffee7dafd27261d8848ea23eb74a2e3 | 8,984 | py | Python | nipype/utils/misc.py | lighthall-lab/NiPype | 80d3f05d9aa006fa3055785327892e8a89530a80 | [
"Apache-2.0"
] | null | null | null | nipype/utils/misc.py | lighthall-lab/NiPype | 80d3f05d9aa006fa3055785327892e8a89530a80 | [
"Apache-2.0"
] | null | null | null | nipype/utils/misc.py | lighthall-lab/NiPype | 80d3f05d9aa006fa3055785327892e8a89530a80 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Miscellaneous utility functions
"""
from __future__ import (print_function, unicode_literals, division,
absolute_import)
from builtins import next, str
im... | 29.552632 | 78 | 0.603851 |
from __future__ import (print_function, unicode_literals, division,
absolute_import)
from builtins import next, str
import sys
import re
from collections import Iterator
from distutils.version import LooseVersion
import numpy as np
from future.utils import raise_from
from future import sta... | true | true |
f7273303519fad0fa8811da7d0c2b7e2b0859a99 | 6,318 | py | Python | src/generated-spec/redshift.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | src/generated-spec/redshift.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | src/generated-spec/redshift.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | from . import *
class AWS_Redshift_ClusterParameterGroup_Parameter(CloudFormationProperty):
def write(self, w):
with w.block("parameter"):
self.property(w, "ParameterName", "parameter_name", StringValueConverter())
self.property(w, "ParameterValue", "parameter_value", StringValueConverter())
class ... | 55.911504 | 363 | 0.755461 | from . import *
class AWS_Redshift_ClusterParameterGroup_Parameter(CloudFormationProperty):
def write(self, w):
with w.block("parameter"):
self.property(w, "ParameterName", "parameter_name", StringValueConverter())
self.property(w, "ParameterValue", "parameter_value", StringValueConverter())
class ... | true | true |
f72733fd03757b454a35ae32f4709e54b50e01e9 | 2,585 | py | Python | lib/python/treadmill/cli/scheduler/__init__.py | drienyov/treadmill | ce21537cd9a2fdb0567ac2aa3de1afcb2f6861de | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/cli/scheduler/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/cli/scheduler/__init__.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | """Top level command for Treadmill reports.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import click
import pandas as pd
import tabulate
from six.moves import urllib_parse
from treadmill import ... | 27.795699 | 78 | 0.635977 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import click
import pandas as pd
import tabulate
from six.moves import urllib_parse
from treadmill import cli
from treadmill import context
from treadmill... | true | true |
f727340d07d3b97b4a2fa74591b9f914b730fdb4 | 730 | py | Python | polygon/__init__.py | pssolanki111/polygon | 99c90950a116f78fdfd8096e354153752c6cdd95 | [
"MIT"
] | 20 | 2021-08-29T10:06:00.000Z | 2022-03-22T07:30:01.000Z | polygon/__init__.py | pssolanki111/polygon | 99c90950a116f78fdfd8096e354153752c6cdd95 | [
"MIT"
] | 1 | 2022-02-16T19:03:12.000Z | 2022-02-25T06:13:51.000Z | polygon/__init__.py | pssolanki111/polygon | 99c90950a116f78fdfd8096e354153752c6cdd95 | [
"MIT"
] | 3 | 2022-01-25T03:34:07.000Z | 2022-02-08T15:06:11.000Z | # ========================================================= #
from .stocks import StocksClient
from .streaming import StreamClient, AsyncStreamClient
from .forex import ForexClient
from .crypto import CryptoClient
from .reference_apis import ReferenceClient
from .options import (OptionsClient, build_option_symbol, pars... | 42.941176 | 116 | 0.591781 | from .stocks import StocksClient
from .streaming import StreamClient, AsyncStreamClient
from .forex import ForexClient
from .crypto import CryptoClient
from .reference_apis import ReferenceClient
from .options import (OptionsClient, build_option_symbol, parse_option_symbol, OptionSymbol,
build_opt... | true | true |
f72734b87340580ae862b0b1ab93d1933cead503 | 608 | py | Python | 100_days_of_code/Beginner/day_13/art.py | Tiago-S-Ribeiro/Python-Pro-Bootcamp | 20a82443fe2e6ee9040ecd9a03853e6c6346592c | [
"MIT"
] | null | null | null | 100_days_of_code/Beginner/day_13/art.py | Tiago-S-Ribeiro/Python-Pro-Bootcamp | 20a82443fe2e6ee9040ecd9a03853e6c6346592c | [
"MIT"
] | null | null | null | 100_days_of_code/Beginner/day_13/art.py | Tiago-S-Ribeiro/Python-Pro-Bootcamp | 20a82443fe2e6ee9040ecd9a03853e6c6346592c | [
"MIT"
] | null | null | null | logo = '''
______ __ __ _ __ __
/ ____/__ __ ___ _____ _____ / /_ / /_ ___ / | / /__ __ ____ ___ / /_ ___ _____
/ / __ / / / // _ \ / ___// ___/ / __// __ \ / _ \ / |/ // / / // __ `__ \ / __ \ / _ \ / ___/
/ /_/ // ... | 86.857143 | 193 | 0.238487 | logo = '''
______ __ __ _ __ __
/ ____/__ __ ___ _____ _____ / /_ / /_ ___ / | / /__ __ ____ ___ / /_ ___ _____
/ / __ / / / // _ \ / ___// ___/ / __// __ \ / _ \ / |/ // / / // __ `__ \ / __ \ / _ \ / ___/
/ /_/ // ... | true | true |
f72734c285abc83d4428383f1e1fdcf37a42b826 | 12,086 | py | Python | mergify_engine/web/root.py | v1v/mergify-engine | 21f63be9987740e1466459f966b186392a235051 | [
"Apache-2.0"
] | null | null | null | mergify_engine/web/root.py | v1v/mergify-engine | 21f63be9987740e1466459f966b186392a235051 | [
"Apache-2.0"
] | 261 | 2020-10-15T15:56:15.000Z | 2022-03-31T07:08:30.000Z | mergify_engine/web/root.py | v1v/mergify-engine | 21f63be9987740e1466459f966b186392a235051 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2019–2021 Mergify SAS
#
# 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 appl... | 34.141243 | 84 | 0.663247 |
import collections
import typing
import aredis
import daiquiri
from datadog import statsd
import fastapi
import httpx
from starlette import requests
from starlette import responses
import voluptuous
from mergify_engine import config
from mergify_engine import github_events
from mergify_engine import gi... | true | true |
f72734f8171a2b98bdc2a9bd97576b05bb2e2d82 | 2,808 | py | Python | lib/googlecloudsdk/dns/dnstools/managed_zone/list.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/dns/dnstools/managed_zone/list.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/dns/dnstools/managed_zone/list.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
"""'dns managed-zone list' command."""
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import properties
from googlecloudsdk.dns.lib import util
class List(base.Command):
... | 33.035294 | 80 | 0.668803 |
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import properties
from googlecloudsdk.dns.lib import util
class List(base.Command):
DEFAULT_MAX_RESULTS = 0
DEFAULT_PAGE_SIZE = 1000
@staticmethod
def Args(parser)... | true | true |
f727357192760291f5ec1451349246fa4f2c9de9 | 1,168 | py | Python | flask_blog/users/utils.py | dungnv2602/flask_blog_showcase | 9508518f30923363b20045640219db5722a7416e | [
"MIT"
] | null | null | null | flask_blog/users/utils.py | dungnv2602/flask_blog_showcase | 9508518f30923363b20045640219db5722a7416e | [
"MIT"
] | 2 | 2021-06-08T19:37:11.000Z | 2022-03-11T23:40:45.000Z | flask_blog/users/utils.py | dungnv2602/flask_blog_showcase | 9508518f30923363b20045640219db5722a7416e | [
"MIT"
] | null | null | null | import os
import secrets
from PIL import Image
from flask_blog import mail
from flask_mail import Message
from flask import current_app, url_for
def save_picture(form_picture):
random_hex = secrets.token_hex(8)
_, f_ext = os.path.splitext(form_picture.filename)
picture_fn = random_hex + f_ext
picture_... | 30.736842 | 95 | 0.69863 | import os
import secrets
from PIL import Image
from flask_blog import mail
from flask_mail import Message
from flask import current_app, url_for
def save_picture(form_picture):
random_hex = secrets.token_hex(8)
_, f_ext = os.path.splitext(form_picture.filename)
picture_fn = random_hex + f_ext
picture_... | true | true |
f72735920d716a47d9d08cd21dfcce0ddb872b79 | 18,672 | py | Python | conans/test/unittests/client/build/cpp_std_flags_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cpp_std_flags_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cpp_std_flags_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | null | null | null | import unittest
from conans.client.build.cppstd_flags import cppstd_default
from conans.test.utils.mocks import MockSettings
from conans.tools import cppstd_flag
def _make_cppstd_flag(compiler, compiler_version, cppstd=None, compiler_base=None):
settings = MockSettings({"compiler": compiler,
... | 61.827815 | 99 | 0.626767 | import unittest
from conans.client.build.cppstd_flags import cppstd_default
from conans.test.utils.mocks import MockSettings
from conans.tools import cppstd_flag
def _make_cppstd_flag(compiler, compiler_version, cppstd=None, compiler_base=None):
settings = MockSettings({"compiler": compiler,
... | true | true |
f72735cd87fa6d88c743eda60cd6425d8578a594 | 1,671 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/region_UG.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | 4 | 2018-10-19T04:36:20.000Z | 2020-02-13T16:14:09.000Z | oscar/lib/python2.7/site-packages/phonenumbers/data/region_UG.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_UG.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. UG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_UG = PhoneMetadata(id='UG', country_code=256, international_prefix='00[057]',
general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}', possible_length=(9,), poss... | 111.4 | 286 | 0.666068 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_UG = PhoneMetadata(id='UG', country_code=256, international_prefix='00[057]',
general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}', possible_length=(9,), possible_length_local_only=(5, 6, 7)),
fixed_line=PhoneNumbe... | true | true |
f72736523caea2797e8de3a4ae833839547bc926 | 2,559 | py | Python | patitasbackend/emailer/views.py | nahuelmol/patitas | 75815aa3b388a538f32395d93b1fa25d7fb6de1a | [
"MIT"
] | 1 | 2021-05-23T16:08:41.000Z | 2021-05-23T16:08:41.000Z | patitasbackend/emailer/views.py | nahuelmol/patitas | 75815aa3b388a538f32395d93b1fa25d7fb6de1a | [
"MIT"
] | null | null | null | patitasbackend/emailer/views.py | nahuelmol/patitas | 75815aa3b388a538f32395d93b1fa25d7fb6de1a | [
"MIT"
] | null | null | null | from django.shortcuts import render
import pickle
import os.path
import mimetypes
import base64
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from email.mime.image import MIMEImage
from email.mime.multipart import... | 28.752809 | 119 | 0.66315 | from django.shortcuts import render
import pickle
import os.path
import mimetypes
import base64
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from email.mime.image import MIMEImage
from email.mime.multipart import... | true | true |
f727369391ddd48ef41823994e2d66ef082c42f9 | 33,146 | py | Python | lingvo/jax/eval.py | ruomingp/lingvo | ba59e8c46471be77d5d3c48177f0f0dd8d5d44e9 | [
"Apache-2.0"
] | null | null | null | lingvo/jax/eval.py | ruomingp/lingvo | ba59e8c46471be77d5d3c48177f0f0dd8d5d44e9 | [
"Apache-2.0"
] | null | null | null | lingvo/jax/eval.py | ruomingp/lingvo | ba59e8c46471be77d5d3c48177f0f0dd8d5d44e9 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 42.010139 | 80 | 0.710221 |
import contextlib
import functools
import hashlib
import os
import time
from typing import List, Optional, Sequence
from absl import logging
import jax
from jax.experimental import maps
from jax.experimental import mesh_utils
from lingvo.jax import base_input
from lingvo.jax import base_layer
from ling... | true | true |
f72737182c2d3650ddf80bd690d0f8357d6c3fc4 | 6,681 | py | Python | tests/api/v2/managers/test_config_api_manager.py | malached/caldera | b622b0b8d0a04bcd0328040cbf53a01b93505afc | [
"Apache-2.0"
] | 1 | 2021-10-06T09:25:18.000Z | 2021-10-06T09:25:18.000Z | tests/api/v2/managers/test_config_api_manager.py | malached/caldera | b622b0b8d0a04bcd0328040cbf53a01b93505afc | [
"Apache-2.0"
] | 1 | 2019-04-25T07:12:14.000Z | 2019-04-25T07:12:14.000Z | tests/api/v2/managers/test_config_api_manager.py | malached/caldera | b622b0b8d0a04bcd0328040cbf53a01b93505afc | [
"Apache-2.0"
] | null | null | null | import pytest
from app.api.v2 import errors
from app.api.v2.managers import config_api_manager
from app.api.v2.managers.config_api_manager import ConfigApiManager, ConfigNotFound, ConfigUpdateNotAllowed
from app.utility.base_world import BaseWorld
class StubDataService:
def __init__(self,):
self.abilitie... | 31.514151 | 108 | 0.68822 | import pytest
from app.api.v2 import errors
from app.api.v2.managers import config_api_manager
from app.api.v2.managers.config_api_manager import ConfigApiManager, ConfigNotFound, ConfigUpdateNotAllowed
from app.utility.base_world import BaseWorld
class StubDataService:
def __init__(self,):
self.abilitie... | true | true |
f727385f21f2d811533cd0c665f73487b0a69b03 | 4,078 | py | Python | salt/runners/git_pillar.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | salt/runners/git_pillar.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2017-07-10T21:44:39.000Z | 2017-07-10T21:44:39.000Z | salt/runners/git_pillar.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | """
Runner module to directly manage the git external pillar
"""
import logging
import salt.pillar.git_pillar
import salt.utils.gitfs
from salt.exceptions import SaltRunnerError
log = logging.getLogger(__name__)
def update(branch=None, repo=None):
"""
.. versionadded:: 2014.1.0
.. versionchanged:: 201... | 37.759259 | 85 | 0.620157 |
import logging
import salt.pillar.git_pillar
import salt.utils.gitfs
from salt.exceptions import SaltRunnerError
log = logging.getLogger(__name__)
def update(branch=None, repo=None):
ret = {}
for ext_pillar in __opts__.get("ext_pillar", []):
pillar_type = next(iter(ext_pillar))
if pillar_ty... | true | true |
f72738ce22a36dacc0601114240ea55abf166fad | 832 | py | Python | FreeTAKServer/controllers/SpecificCoTControllers/SendFederatedCoT.py | Tapawingo/FreeTakServer | 30259fa0fb5a69bbf6606f06d9cd40a63d2aa4fd | [
"MIT"
] | 27 | 2020-05-01T01:45:59.000Z | 2020-07-03T00:17:13.000Z | FreeTAKServer/controllers/SpecificCoTControllers/SendFederatedCoT.py | Tapawingo/FreeTakServer | 30259fa0fb5a69bbf6606f06d9cd40a63d2aa4fd | [
"MIT"
] | 34 | 2020-04-26T11:25:52.000Z | 2020-07-03T21:06:34.000Z | FreeTAKServer/controllers/SpecificCoTControllers/SendFederatedCoT.py | Tapawingo/FreeTakServer | 30259fa0fb5a69bbf6606f06d9cd40a63d2aa4fd | [
"MIT"
] | 15 | 2020-05-01T01:46:07.000Z | 2020-07-03T12:14:04.000Z | from FreeTAKServer.model.SpecificCoT.SendFederatedCoT import SendFederatedCoT
from .SendCoTAbstractController import SendCoTAbstractController
from FreeTAKServer.controllers.configuration.LoggingConstants import LoggingConstants
from FreeTAKServer.controllers.CreateLoggerController import CreateLoggerController
loggin... | 52 | 114 | 0.78125 | from FreeTAKServer.model.SpecificCoT.SendFederatedCoT import SendFederatedCoT
from .SendCoTAbstractController import SendCoTAbstractController
from FreeTAKServer.controllers.configuration.LoggingConstants import LoggingConstants
from FreeTAKServer.controllers.CreateLoggerController import CreateLoggerController
loggin... | true | true |
f7273915b911e2c9ab5a33795229deb37059132d | 22,981 | py | Python | Tools/scripts/freeze_modules.py | erickpeirson/cpython | d441437ee71ae174c008c23308b749b91020ba77 | [
"0BSD"
] | null | null | null | Tools/scripts/freeze_modules.py | erickpeirson/cpython | d441437ee71ae174c008c23308b749b91020ba77 | [
"0BSD"
] | null | null | null | Tools/scripts/freeze_modules.py | erickpeirson/cpython | d441437ee71ae174c008c23308b749b91020ba77 | [
"0BSD"
] | null | null | null | """Freeze modules and regen related files (e.g. Python/frozen.c).
See the notes at the top of Python/frozen.c for more info.
"""
from collections import namedtuple
import hashlib
import os
import ntpath
import posixpath
import platform
import subprocess
import sys
import textwrap
import time
from update_file import ... | 32.924069 | 93 | 0.591576 |
from collections import namedtuple
import hashlib
import os
import ntpath
import posixpath
import platform
import subprocess
import sys
import textwrap
import time
from update_file import updating_file_with_tmpfile, update_file_with_tmpfile
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
ROOT... | true | true |
f72739fb303514524a1f36a098a48adc38f45626 | 4,753 | py | Python | explain.py | pakesson/scaml | c69d422d6839d75a81426c81fd8d570fa421744b | [
"MIT"
] | 1 | 2020-12-03T01:34:47.000Z | 2020-12-03T01:34:47.000Z | explain.py | pakesson/scaml | c69d422d6839d75a81426c81fd8d570fa421744b | [
"MIT"
] | null | null | null | explain.py | pakesson/scaml | c69d422d6839d75a81426c81fd8d570fa421744b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import math
import numpy as np
from tensorflow.keras.models import load_model
from aes import aes_sbox, aes_sbox_inv
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
def get_label(plaintext, key, index):
return aes_sbox[plaintext[index] ^ key[index]]
n... | 36.007576 | 138 | 0.708605 |
import sys
import math
import numpy as np
from tensorflow.keras.models import load_model
from aes import aes_sbox, aes_sbox_inv
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
def get_label(plaintext, key, index):
return aes_sbox[plaintext[index] ^ key[index]]
num_classes = 256
atta... | true | true |
f7273a7b5d7bdf69557a4052a69a66f7ebffb3ac | 588 | py | Python | stats/attendance.py | diegomrsantos/Python-Baseball | 4543df7a4d74e82106a3e8481553149c447d8ab6 | [
"MIT"
] | null | null | null | stats/attendance.py | diegomrsantos/Python-Baseball | 4543df7a4d74e82106a3e8481553149c447d8ab6 | [
"MIT"
] | null | null | null | stats/attendance.py | diegomrsantos/Python-Baseball | 4543df7a4d74e82106a3e8481553149c447d8ab6 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from data import games
info_filter = games['type'] == 'info'
attendance_filter = games['multi2'] == 'attendance'
attendance = games.loc[info_filter & attendance_filter, ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] ... | 32.666667 | 91 | 0.710884 | import pandas as pd
import matplotlib.pyplot as plt
from data import games
info_filter = games['type'] == 'info'
attendance_filter = games['multi2'] == 'attendance'
attendance = games.loc[info_filter & attendance_filter, ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] ... | true | true |
f7273aa823161ba436cb65218833b108a92b9ccc | 651 | py | Python | tests/test_pickling_in_main/main.py | smheidrich/pickle-spree | 73d7a6fd1265f28fc3b91db593309cf5d2ae9195 | [
"MIT"
] | null | null | null | tests/test_pickling_in_main/main.py | smheidrich/pickle-spree | 73d7a6fd1265f28fc3b91db593309cf5d2ae9195 | [
"MIT"
] | 2 | 2022-01-23T18:51:13.000Z | 2022-01-23T18:54:36.000Z | tests/test_pickling_in_main/main.py | smheidrich/pickle-spree | 73d7a6fd1265f28fc3b91db593309cf5d2ae9195 | [
"MIT"
] | null | null | null | from collections import ChainMap
import os
from pathlib import Path
from pickle_spree import PopenFactory
import subprocess
import sys
class CallableDefinedInMain:
def __call__(self):
return 1
callable = CallableDefinedInMain()
new_popen = PopenFactory(callable=callable)
subprocess.Popen = new_popen
pythonpa... | 25.038462 | 74 | 0.752688 | from collections import ChainMap
import os
from pathlib import Path
from pickle_spree import PopenFactory
import subprocess
import sys
class CallableDefinedInMain:
def __call__(self):
return 1
callable = CallableDefinedInMain()
new_popen = PopenFactory(callable=callable)
subprocess.Popen = new_popen
pythonpa... | true | true |
f7273b4fd11cad1a9484b1fbcd350c2e7b6f9e26 | 377 | py | Python | Exercicio6TapeEquilibrium/ResolucaoPropria/start.py | GRParasky/codility-exercises | 1a7144492d78fd712ec8d23d94502e3f5ed642a3 | [
"MIT"
] | null | null | null | Exercicio6TapeEquilibrium/ResolucaoPropria/start.py | GRParasky/codility-exercises | 1a7144492d78fd712ec8d23d94502e3f5ed642a3 | [
"MIT"
] | null | null | null | Exercicio6TapeEquilibrium/ResolucaoPropria/start.py | GRParasky/codility-exercises | 1a7144492d78fd712ec8d23d94502e3f5ed642a3 | [
"MIT"
] | null | null | null | def solution(A):
list_range = len(A)
difference_list = []
for p in range(1, list_range):
post_sum = sum(A[p:])
behind_sum = sum(A[:p])
difference = behind_sum - post_sum
if difference < 0:
difference *= -1
difference_list.append(difference)
retur... | 18.85 | 42 | 0.572944 | def solution(A):
list_range = len(A)
difference_list = []
for p in range(1, list_range):
post_sum = sum(A[p:])
behind_sum = sum(A[:p])
difference = behind_sum - post_sum
if difference < 0:
difference *= -1
difference_list.append(difference)
retur... | true | true |
f7273bbbd5fff48873e854018e8ac2d206d735b8 | 12,117 | py | Python | .github/scripts/check-header.py | githubliweichao/FreeRTOS | 208b260f982d7a0c8b9aaff6bc446f8c7e45d2e2 | [
"MIT"
] | 1 | 2020-12-20T03:45:04.000Z | 2020-12-20T03:45:04.000Z | .github/scripts/check-header.py | githubliweichao/FreeRTOS | 208b260f982d7a0c8b9aaff6bc446f8c7e45d2e2 | [
"MIT"
] | null | null | null | .github/scripts/check-header.py | githubliweichao/FreeRTOS | 208b260f982d7a0c8b9aaff6bc446f8c7e45d2e2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os, sys, re
from argparse import ArgumentParser
from difflib import unified_diff
from json import load
def dprint(msg):
print('[DEBUG]: %s' % str(msg))
class HeaderChecker:
def __init__(self, header, padding=1000, ignored_files=[], ignored_ext=[], ignored_patterns=[]):
s... | 25.035124 | 116 | 0.505241 |
import os, sys, re
from argparse import ArgumentParser
from difflib import unified_diff
from json import load
def dprint(msg):
print('[DEBUG]: %s' % str(msg))
class HeaderChecker:
def __init__(self, header, padding=1000, ignored_files=[], ignored_ext=[], ignored_patterns=[]):
self.padding = padding
... | true | true |
f7273bc9f69a30526a9b3eca4ec533b0eff5edfe | 11,534 | py | Python | evaluate/evaluate_FDR.py | rperi/trustworthy-asv-fairness | 15df69a8f3f8ad5262002c9e3d12aa12ea8f1c6f | [
"MIT"
] | 1 | 2022-03-30T07:50:10.000Z | 2022-03-30T07:50:10.000Z | evaluate/evaluate_FDR.py | rperi/trustworthy-asv-fairness | 15df69a8f3f8ad5262002c9e3d12aa12ea8f1c6f | [
"MIT"
] | null | null | null | evaluate/evaluate_FDR.py | rperi/trustworthy-asv-fairness | 15df69a8f3f8ad5262002c9e3d12aa12ea8f1c6f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
import pdb
from scipy.spatial.distance import cosine
from sklearn.metrics import roc_curve, confusion_matrix
import sys
from tqdm import tqdm
from sklearn.metrics import auc
import argparse
fprs = [0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.2,0.3,0.4,0.5]
groups... | 46.321285 | 216 | 0.658401 | import numpy as np
import pandas as pd
import os
import pdb
from scipy.spatial.distance import cosine
from sklearn.metrics import roc_curve, confusion_matrix
import sys
from tqdm import tqdm
from sklearn.metrics import auc
import argparse
fprs = [0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.2,0.3,0.4,0.5]
groups... | true | true |
f7273c1bf115cb1687982e0d1e6f9de4ff2abedf | 11,677 | py | Python | com/precisely/apis/model/individual_value_variable.py | PreciselyData/PreciselyAPIsSDK-Python | 28ffff0c96d81d3a53a5599c987d54d7b632b508 | [
"Apache-2.0"
] | null | null | null | com/precisely/apis/model/individual_value_variable.py | PreciselyData/PreciselyAPIsSDK-Python | 28ffff0c96d81d3a53a5599c987d54d7b632b508 | [
"Apache-2.0"
] | null | null | null | com/precisely/apis/model/individual_value_variable.py | PreciselyData/PreciselyAPIsSDK-Python | 28ffff0c96d81d3a53a5599c987d54d7b632b508 | [
"Apache-2.0"
] | null | null | null | """
Precisely APIs
Enhance & enrich your data, applications, business processes, and workflows with rich location, information, and identify APIs. # noqa: E501
The version of the OpenAPI document: 11.9.3
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F4... | 43.570896 | 145 | 0.565899 |
import re
import sys
from com.precisely.apis.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
... | true | true |
f7273c9914ccfd701d1ff364fe87e5615b331733 | 1,279 | py | Python | ownblock/ownblock/apps/notices/migrations/0001_initial.py | danjac/ownblock | ac662fb7efb2f04567e2f85638c1250286452611 | [
"MIT"
] | 3 | 2015-06-12T04:42:02.000Z | 2018-10-29T17:09:10.000Z | ownblock/ownblock/apps/notices/migrations/0001_initial.py | danjac/ownblock | ac662fb7efb2f04567e2f85638c1250286452611 | [
"MIT"
] | null | null | null | ownblock/ownblock/apps/notices/migrations/0001_initial.py | danjac/ownblock | ac662fb7efb2f04567e2f85638c1250286452611 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('buildings', '__first__'),
migrations.swappabl... | 36.542857 | 147 | 0.620797 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('buildings', '__first__'),
migrations.swappable_dependency(settings.A... | true | true |
f7273d2cdf1526800b8a09c10a36d9eb9438cb1e | 333 | py | Python | Exercicios/Desafio033.py | victorhugof94/Python | 8b42955634f3ae44bded350ac88396a02b1f6970 | [
"MIT"
] | null | null | null | Exercicios/Desafio033.py | victorhugof94/Python | 8b42955634f3ae44bded350ac88396a02b1f6970 | [
"MIT"
] | null | null | null | Exercicios/Desafio033.py | victorhugof94/Python | 8b42955634f3ae44bded350ac88396a02b1f6970 | [
"MIT"
] | null | null | null | n1 = int(input('primeiro numero:'))
n2 = int(input('segundo numero:'))
n3 = int(input('terceiro numero:'))
menor = n1
if n2<n1 and n2<n3:
menor=n2
if n3<n1 and n3<n2:
menor=n3
maior = n1
if n2>n1 and n2>n3:
maior=n2
if n3>n1 and n3>n2:
maior=n3
print ('menor = {}'.format(menor))
print ('maior = {}'.f... | 18.5 | 35 | 0.621622 | n1 = int(input('primeiro numero:'))
n2 = int(input('segundo numero:'))
n3 = int(input('terceiro numero:'))
menor = n1
if n2<n1 and n2<n3:
menor=n2
if n3<n1 and n3<n2:
menor=n3
maior = n1
if n2>n1 and n2>n3:
maior=n2
if n3>n1 and n3>n2:
maior=n3
print ('menor = {}'.format(menor))
print ('maior = {}'.f... | true | true |
f7273d39afe2ba8bd90bcbf4e85702e9d6bb3817 | 43,399 | py | Python | podpac/core/coordinates/test/test_uniform_coordinates1d.py | creare-com/podpac | 7feb5c957513c146ce73ba1c36c630284f513a6e | [
"Apache-2.0"
] | 46 | 2018-04-06T19:54:32.000Z | 2022-02-08T02:00:02.000Z | podpac/core/coordinates/test/test_uniform_coordinates1d.py | creare-com/podpac | 7feb5c957513c146ce73ba1c36c630284f513a6e | [
"Apache-2.0"
] | 474 | 2018-04-05T22:21:09.000Z | 2022-02-24T14:21:16.000Z | podpac/core/coordinates/test/test_uniform_coordinates1d.py | creare-com/podpac | 7feb5c957513c146ce73ba1c36c630284f513a6e | [
"Apache-2.0"
] | 4 | 2019-04-11T17:49:53.000Z | 2020-11-29T22:36:53.000Z | from datetime import datetime
import json
import pytest
import traitlets as tl
import numpy as np
from numpy.testing import assert_equal
import podpac
from podpac.core.coordinates.utils import make_coord_array
from podpac.core.coordinates.coordinates1d import Coordinates1d
from podpac.core.coordinates.array_coordinat... | 34.999194 | 111 | 0.57446 | from datetime import datetime
import json
import pytest
import traitlets as tl
import numpy as np
from numpy.testing import assert_equal
import podpac
from podpac.core.coordinates.utils import make_coord_array
from podpac.core.coordinates.coordinates1d import Coordinates1d
from podpac.core.coordinates.array_coordinat... | true | true |
f7273dd94996a596fd89b435c509524733c41b42 | 4,323 | py | Python | lyft_CNN.py | govindap/lyft_motion_prediction | 15412444fec69ce4a0082d8de730cb882833eab0 | [
"Apache-2.0"
] | null | null | null | lyft_CNN.py | govindap/lyft_motion_prediction | 15412444fec69ce4a0082d8de730cb882833eab0 | [
"Apache-2.0"
] | null | null | null | lyft_CNN.py | govindap/lyft_motion_prediction | 15412444fec69ce4a0082d8de730cb882833eab0 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision.models.resnet import resnet50, resnet34
from torch import Tensor
from typing import Dict
from l5kit.configs import load_config_data
from l5kit.data import LocalDataManager, ChunkedDataset
from l5kit.dat... | 31.100719 | 101 | 0.635901 | import numpy as np
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision.models.resnet import resnet50, resnet34
from torch import Tensor
from typing import Dict
from l5kit.configs import load_config_data
from l5kit.data import LocalDataManager, ChunkedDataset
from l5kit.dat... | true | true |
f7273e61673d7705a50b7baced2d412d3ccc1539 | 167 | py | Python | backend/course_application/apps.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | backend/course_application/apps.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | backend/course_application/apps.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class CourseApplicationConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'course_application'
| 23.857143 | 56 | 0.790419 | from django.apps import AppConfig
class CourseApplicationConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'course_application'
| true | true |
f7273e63342dcead5dd52298df0ffc0e7b2d6ce6 | 41 | py | Python | addons/mail_client_extension/controllers/__init__.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/mail_client_extension/controllers/__init__.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/mail_client_extension/controllers/__init__.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*
from . import main | 20.5 | 22 | 0.585366 |
from . import main | true | true |
f7273ea22419d001ae46764df21f035e585f8246 | 1,368 | py | Python | gitflow/util.py | chassing/gitflow | 722ec6a68165bac80443eecf97bd00b8f7818b50 | [
"BSD-3-Clause"
] | 7 | 2015-05-09T20:31:36.000Z | 2021-05-17T02:14:30.000Z | gitflow/util.py | chassing/gitflow | 722ec6a68165bac80443eecf97bd00b8f7818b50 | [
"BSD-3-Clause"
] | 5 | 2016-05-31T22:15:08.000Z | 2021-02-16T08:44:28.000Z | gitflow/util.py | chassing/gitflow | 722ec6a68165bac80443eecf97bd00b8f7818b50 | [
"BSD-3-Clause"
] | 10 | 2016-05-31T21:41:25.000Z | 2021-04-11T13:33:48.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
#
# Shamelessly ripped from
# http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/
#
def itersubclasses(cls, _seen=None):
"""
itersubclasses(cls)
... | 27.36 | 82 | 0.57383 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
def itersubclasses(cls, _seen=None):
if not isinstance(cls, type):
raise TypeError('itersubclasses must be called with '
'new-style classes, not %.100r' % cls)
if ... | true | true |
f7273ee822a983a7b06727171c767b66a9c5a749 | 1,054 | py | Python | tests/functional/test_hooks/test_six.py | yoda-vid/pyinstaller | 419f349dad721a253b19d9c596e251818132d6ba | [
"Apache-2.0"
] | 2 | 2017-02-08T22:22:09.000Z | 2020-10-08T12:28:36.000Z | tests/functional/test_hooks/test_six.py | 416426/pyinstaller | 0f2b2e921433ab5a510c7efdb21d9c1d7cfbc645 | [
"Apache-2.0"
] | 3 | 2020-04-06T15:48:37.000Z | 2021-03-23T10:22:21.000Z | tests/functional/test_hooks/test_six.py | 416426/pyinstaller | 0f2b2e921433ab5a510c7efdb21d9c1d7cfbc645 | [
"Apache-2.0"
] | 4 | 2018-06-04T20:40:37.000Z | 2020-10-13T22:38:40.000Z | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... | 34 | 78 | 0.627135 |
from PyInstaller.utils.tests import importorskip
@importorskip('six.moves')
def test_six_moves(pyi_builder):
pyi_builder.test_source(
"""
from six.moves import UserList
UserList
""")
@importorskip('six.moves')
def test_six_moves_2nd_run(pyi_builder):
return tes... | true | true |
f7273f7676d92413f9cd5cae85de640904f6032a | 8,163 | py | Python | accelbyte_py_sdk/api/cloudsave/operations/concurrent_record/put_game_record_concurrent_handler_v1.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/operations/concurrent_record/put_game_record_concurrent_handler_v1.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/operations/concurrent_record/put_game_record_concurrent_handler_v1.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | # Auto-generated at 2021-09-27T17:01:31.256010+08:00
# from: Justice Cloudsave Service (3.38.0)
# Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
# pylint: disable=duplicate-code
# p... | 30.233333 | 137 | 0.61987 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from .....core import Operation
from .....core import HttpResponse
from ...models import ModelsConcurrentRecordRequest
from ...models import ResponseError
class PutGameRecordConcurrentHandlerV1(Operati... | true | true |
f72740045bcd8582e8aa4a06002d0eadbb562489 | 2,739 | py | Python | main.py | sem-onyalo/gan-textures | ed75ce150d98920bf0d1f0a00ff42d3992c0e32e | [
"MIT"
] | null | null | null | main.py | sem-onyalo/gan-textures | ed75ce150d98920bf0d1f0a00ff42d3992c0e32e | [
"MIT"
] | null | null | null | main.py | sem-onyalo/gan-textures | ed75ce150d98920bf0d1f0a00ff42d3992c0e32e | [
"MIT"
] | null | null | null | import argparse
import logging
from model import DCGAN_1024
def init_logger():
logging.basicConfig(
format="[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s",
datefmt="%Y/%m/%d %H:%M:%S",
level=logging.INFO
)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
pa... | 38.577465 | 81 | 0.680175 | import argparse
import logging
from model import DCGAN_1024
def init_logger():
logging.basicConfig(
format="[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s",
datefmt="%Y/%m/%d %H:%M:%S",
level=logging.INFO
)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
pa... | true | true |
f727406dcaa18843458f6c479462d8f14bb82493 | 2,802 | py | Python | DLCoursera_part1_week4_1.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | DLCoursera_part1_week4_1.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | DLCoursera_part1_week4_1.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | import numpy as np
from dnn_utils import sigmoid,sigmoid_backward,relu,relu_backward
def initialize_two_layer(n_x,n_h,n_y):
W1 = np.random.randn(n_h,n_x) * 0.01
b1 = np.zeros(n_h,1)
W2 = np.random.randn(n_y,n_h) * 0.01
b2 = np.zeros(n_y,1)
param = {"W1":W1,"b1":b1,"W2":W2,"b2":b2}
return param
def initialize... | 22.062992 | 115 | 0.662384 | import numpy as np
from dnn_utils import sigmoid,sigmoid_backward,relu,relu_backward
def initialize_two_layer(n_x,n_h,n_y):
W1 = np.random.randn(n_h,n_x) * 0.01
b1 = np.zeros(n_h,1)
W2 = np.random.randn(n_y,n_h) * 0.01
b2 = np.zeros(n_y,1)
param = {"W1":W1,"b1":b1,"W2":W2,"b2":b2}
return param
def initialize... | true | true |
f727409d08bf28ed9c3b7b788835af2b38189f4f | 15,624 | py | Python | word2vec_basic.py | rmodi6/word-representations | 4f9a13cee9ff60ce3c667c833330b59de774ed39 | [
"MIT"
] | null | null | null | word2vec_basic.py | rmodi6/word-representations | 4f9a13cee9ff60ce3c667c833330b59de774ed39 | [
"MIT"
] | null | null | null | word2vec_basic.py | rmodi6/word-representations | 4f9a13cee9ff60ce3c667c833330b59de774ed39 | [
"MIT"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.467626 | 113 | 0.662186 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
import os, sys
import random
import zipfile
import numpy as np
from six.moves import urllib
from six.moves import xrange
import tensorflow as tf
import loss_func... | true | true |
f7274148a77ac245be2e506c83b47f5520833782 | 2,404 | py | Python | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py | gayangunarathne/private-paas | d4dd794a7dcf46312d17e81fe0442e42d30c8c63 | [
"Apache-2.0"
] | null | null | null | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py | gayangunarathne/private-paas | d4dd794a7dcf46312d17e81fe0442e42d30c8c63 | [
"Apache-2.0"
] | null | null | null | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py | gayangunarathne/private-paas | d4dd794a7dcf46312d17e81fe0442e42d30c8c63 | [
"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 u... | 32.931507 | 110 | 0.669301 |
import time
from threading import Thread
class AbstractAsyncScheduledTask:
def execute_task(self):
raise NotImplementedError
class ScheduledExecutor(Thread):
def __init__(self, delay, task):
Thread.__init__(self)
self.delay = delay
self.task = task
... | true | true |
f727415cbcd7b0a3044c71aebd591a61b3989d00 | 393 | py | Python | techtest/asgi.py | rising-entropy/Techcurve-Test | eeefd14d1a83451b9b5333f582ed6cc12efca44c | [
"MIT"
] | null | null | null | techtest/asgi.py | rising-entropy/Techcurve-Test | eeefd14d1a83451b9b5333f582ed6cc12efca44c | [
"MIT"
] | null | null | null | techtest/asgi.py | rising-entropy/Techcurve-Test | eeefd14d1a83451b9b5333f582ed6cc12efca44c | [
"MIT"
] | 1 | 2021-03-26T11:39:15.000Z | 2021-03-26T11:39:15.000Z | """
ASGI config for techtest project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'techtest.settings')
application = get_asgi_application()
| true | true |
f72741a466183d81d1fca4196b837b1a9535f959 | 6,357 | py | Python | read_xml_all/calcul_matrix_compare_ce_good_192matrix.py | daniel20162016/my-first | f9554dd476302b26e8a296393025f150922f349c | [
"MIT"
] | null | null | null | read_xml_all/calcul_matrix_compare_ce_good_192matrix.py | daniel20162016/my-first | f9554dd476302b26e8a296393025f150922f349c | [
"MIT"
] | null | null | null | read_xml_all/calcul_matrix_compare_ce_good_192matrix.py | daniel20162016/my-first | f9554dd476302b26e8a296393025f150922f349c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 31 15:45:22 2016
@author: wang
"""
#from matplotlib import pylab as plt
#from numpy import fft, fromstring, int16, linspace
#import wave
from read_wav_xml_good_1 import*
from matrix_24_2 import*
from max_matrix_norm import*
import numpy as np
# open a wave file
filename... | 39.240741 | 147 | 0.532012 |
from read_wav_xml_good_1 import*
from matrix_24_2 import*
from max_matrix_norm import*
import numpy as np
filename = 'francois_filon_pure_3.wav'
filename_1 ='francois_filon_pure_3.xml'
word ='ce'
wave_signal_float,framerate, word_start_point, word_length_point, word_end_point= read_wav_xml_good_1(filename,filen... | true | true |
f7274274d7a0048e67b5610c186be3f936227e5f | 1,037 | py | Python | debussy_concert/data_ingestion/config/movement_parameters/time_partitioned.py | DotzInc/debussy_concert | a28d7ca01814f24ffa75cfece758d619b71509f2 | [
"Apache-2.0"
] | 3 | 2022-03-23T19:16:25.000Z | 2022-03-30T18:12:19.000Z | debussy_concert/data_ingestion/config/movement_parameters/time_partitioned.py | DotzInc/debussy_concert | a28d7ca01814f24ffa75cfece758d619b71509f2 | [
"Apache-2.0"
] | null | null | null | debussy_concert/data_ingestion/config/movement_parameters/time_partitioned.py | DotzInc/debussy_concert | a28d7ca01814f24ffa75cfece758d619b71509f2 | [
"Apache-2.0"
] | 1 | 2022-03-23T20:14:48.000Z | 2022-03-23T20:14:48.000Z | from dataclasses import dataclass
from debussy_concert.core.config.movement_parameters.base import MovementParametersBase
@dataclass(frozen=True)
class BigQueryDataPartitioning:
partitioning_type: str
gcs_partition_schema: str
partition_field: str
destination_partition: str
@dataclass(frozen=True)
c... | 34.566667 | 87 | 0.802314 | from dataclasses import dataclass
from debussy_concert.core.config.movement_parameters.base import MovementParametersBase
@dataclass(frozen=True)
class BigQueryDataPartitioning:
partitioning_type: str
gcs_partition_schema: str
partition_field: str
destination_partition: str
@dataclass(frozen=True)
c... | true | true |
f72742b11c9975baf67b3cee27f9d5f9ddcb878a | 1,593 | py | Python | userbot/plugins/instastory_x3.py | x3raqee/x3raqe | d062ace8d69895a8ab80a003fc76da63e2b63a1d | [
"Apache-2.0"
] | null | null | null | userbot/plugins/instastory_x3.py | x3raqee/x3raqe | d062ace8d69895a8ab80a003fc76da63e2b63a1d | [
"Apache-2.0"
] | null | null | null | userbot/plugins/instastory_x3.py | x3raqee/x3raqe | d062ace8d69895a8ab80a003fc76da63e2b63a1d | [
"Apache-2.0"
] | 1 | 2021-04-27T23:28:43.000Z | 2021-04-27T23:28:43.000Z | # @x3raqe
#ممول محمد
"""QuotLy: Avaible commands: .انستا
"""
import datetime
import asyncio
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from userbot.utils import admin_cmd
@borg.on(admin_cmd... | 37.046512 | 102 | 0.629002 |
import datetime
import asyncio
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from userbot.utils import admin_cmd
@borg.on(admin_cmd(pattern="ستوري ?(.*)"))
async def _(event):
if event.fwd_... | true | true |
f72743000a24fcbc0e4390eb46261f96678ebe0b | 956 | py | Python | jdcloud_sdk/services/vod/models/UpdateTranscodeTemplateGroupReqData.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/vod/models/UpdateTranscodeTemplateGroupReqData.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/vod/models/UpdateTranscodeTemplateGroupReqData.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 31.866667 | 75 | 0.722803 |
class UpdateTranscodeTemplateGroupReqData(object):
def __init__(self, groupName=None, templates=None):
self.groupName = groupName
self.templates = templates
| true | true |
f72743d6ec89246b1658151bdccfda8fc5b489b1 | 8,498 | py | Python | docs/conf.py | Akhail/Tebless | 87faff5547f168d0cf2d5caaf313c1efe1c19950 | [
"MIT"
] | 5 | 2017-09-20T02:12:25.000Z | 2019-10-22T14:12:07.000Z | docs/conf.py | mdbetancourt/Tebless | 87faff5547f168d0cf2d5caaf313c1efe1c19950 | [
"MIT"
] | 3 | 2021-06-14T14:20:53.000Z | 2021-11-15T17:47:37.000Z | docs/conf.py | Akhail/Tebless | 87faff5547f168d0cf2d5caaf313c1efe1c19950 | [
"MIT"
] | 1 | 2021-04-13T14:03:53.000Z | 2021-04-13T14:03:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tebless documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 30.6787 | 76 | 0.717581 |
import sys
import os
import sphinx_rtd_theme
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import tebless
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = '... | true | true |
f72744a63d45a288c51ef43928f1452981437cd1 | 2,703 | py | Python | snake.py | leonardoarthur/SnakeGame | 106d3d238fd0d15091aa25d1770886961cedcc73 | [
"MIT"
] | 1 | 2021-05-03T02:03:36.000Z | 2021-05-03T02:03:36.000Z | snake.py | leonardoarthur/SnakeGame | 106d3d238fd0d15091aa25d1770886961cedcc73 | [
"MIT"
] | null | null | null | snake.py | leonardoarthur/SnakeGame | 106d3d238fd0d15091aa25d1770886961cedcc73 | [
"MIT"
] | null | null | null | import pygame
import random
pygame.init()
azul = (50, 100, 213)
laranja = (205, 102, 0)
verde = (0, 255, 0)
amarelo = (255, 255, 102)
dimensoes = (600, 600)
x = 300
y = 300
d = 20
lista_cobra = [[x, y]]
dx = 0
dy = 0
x_comida = round(random.randrange(0, 600 - d) /20) * 20
y_comida = round(random.randrange(0, 60... | 24.572727 | 94 | 0.607103 | import pygame
import random
pygame.init()
azul = (50, 100, 213)
laranja = (205, 102, 0)
verde = (0, 255, 0)
amarelo = (255, 255, 102)
dimensoes = (600, 600)
x = 300
y = 300
d = 20
lista_cobra = [[x, y]]
dx = 0
dy = 0
x_comida = round(random.randrange(0, 600 - d) /20) * 20
y_comida = round(random.randrange(0, 60... | true | true |
f7274749a010a84dccc4f71883f73ec4a8832b8a | 417 | py | Python | glitter/migrations/0004_object_id_required.py | dhamaniasad/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 3 | 2017-06-01T16:22:18.000Z | 2018-08-22T21:45:55.000Z | glitter/migrations/0004_object_id_required.py | blancltd/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 85 | 2016-02-25T10:34:03.000Z | 2017-04-03T11:07:59.000Z | glitter/migrations/0004_object_id_required.py | blancltd/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 1 | 2016-08-02T08:21:19.000Z | 2016-08-02T08:21:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('glitter', '0003_remove_empty_contentblocks'),
]
operations = [
migrations.AlterField(
model_name='contentblock',... | 20.85 | 55 | 0.621103 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('glitter', '0003_remove_empty_contentblocks'),
]
operations = [
migrations.AlterField(
model_name='contentblock',
name='obje... | true | true |
f72747c52a599d07bf9a7350a23de712aeb51d69 | 3,190 | py | Python | app/result/views.py | Ravishrks/examin | 974f8d86ca116b3135a482e8e81532a40ea187c3 | [
"MIT"
] | null | null | null | app/result/views.py | Ravishrks/examin | 974f8d86ca116b3135a482e8e81532a40ea187c3 | [
"MIT"
] | null | null | null | app/result/views.py | Ravishrks/examin | 974f8d86ca116b3135a482e8e81532a40ea187c3 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views import View
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponse
from result.models import ResponseSheet
import os
im... | 34.673913 | 156 | 0.601254 | from django.shortcuts import render, redirect
from django.views import View
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponse
from result.models import ResponseSheet
import os
im... | true | true |
f727483e267d49216f2db46205941f51cd603a86 | 544 | py | Python | src/manage.py | tegarty/socialrating | b80888ee8e637bd0a5517614c78235d563fead2e | [
"BSD-3-Clause"
] | 1 | 2019-02-03T17:17:02.000Z | 2019-02-03T17:17:02.000Z | src/manage.py | tegarty/socialrating | b80888ee8e637bd0a5517614c78235d563fead2e | [
"BSD-3-Clause"
] | null | null | null | src/manage.py | tegarty/socialrating | b80888ee8e637bd0a5517614c78235d563fead2e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialrating.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django.... | 34 | 76 | 0.689338 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialrating.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's in... | true | true |
f7274a0d65eb66f00c4a41033040a9f2ae9f8cac | 18,672 | py | Python | autobahn/wamp/interfaces.py | meejah/AutobahnPython | 54da8882eea3f4b1da62a6d3481556ab77720d41 | [
"MIT"
] | null | null | null | autobahn/wamp/interfaces.py | meejah/AutobahnPython | 54da8882eea3f4b1da62a6d3481556ab77720d41 | [
"MIT"
] | null | null | null | autobahn/wamp/interfaces.py | meejah/AutobahnPython | 54da8882eea3f4b1da62a6d3481556ab77720d41 | [
"MIT"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | 37.569416 | 106 | 0.658044 | true | true | |
f7274b9a30433a0e80ac0f1cf680738f5e8edb50 | 20,559 | py | Python | PyDSS/pyPostprocessor/PostprocessScripts/DERMSOptimizer_helper_modules/opt_funcs.py | daniel-thom/PyDSS | 8c7ae2d3a17d596b42a92e33f7d29329e26fbc30 | [
"BSD-3-Clause"
] | 1 | 2020-11-25T17:52:53.000Z | 2020-11-25T17:52:53.000Z | PyDSS/pyPostprocessor/PostprocessScripts/DERMSOptimizer_helper_modules/opt_funcs.py | daniel-thom/PyDSS | 8c7ae2d3a17d596b42a92e33f7d29329e26fbc30 | [
"BSD-3-Clause"
] | null | null | null | PyDSS/pyPostprocessor/PostprocessScripts/DERMSOptimizer_helper_modules/opt_funcs.py | daniel-thom/PyDSS | 8c7ae2d3a17d596b42a92e33f7d29329e26fbc30 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T19:52:02.000Z | 2020-07-23T19:52:02.000Z | import numpy as np
from scipy.sparse import lil_matrix
import scipy.sparse.linalg as sp
import scipy.sparse as sparse
import math
import csv
import matplotlib.pyplot as plt
def linear_powerflow_model(Y00,Y01,Y10,Y11_inv,I_coeff,V1,slack_no):
# voltage linearlization
V1_conj = np.conj(V1[slack_no:])
V1_conj... | 45.686667 | 182 | 0.555329 | import numpy as np
from scipy.sparse import lil_matrix
import scipy.sparse.linalg as sp
import scipy.sparse as sparse
import math
import csv
import matplotlib.pyplot as plt
def linear_powerflow_model(Y00,Y01,Y10,Y11_inv,I_coeff,V1,slack_no):
V1_conj = np.conj(V1[slack_no:])
V1_conj_inv = 1 / V1_conj
c... | true | true |
f7274bbaa9b6a7c957dcc7b0ce646d02630be40a | 956 | py | Python | link_lang_spacy.py | bothub-it/bothub-nlp-ai-platform | 94f1fae57b8e81ed5f71839df6d47b1ee0df53f6 | [
"MIT"
] | null | null | null | link_lang_spacy.py | bothub-it/bothub-nlp-ai-platform | 94f1fae57b8e81ed5f71839df6d47b1ee0df53f6 | [
"MIT"
] | 2 | 2020-06-23T13:57:20.000Z | 2022-02-09T23:39:15.000Z | link_lang_spacy.py | bothub-it/bothub-nlp-ai-platform | 94f1fae57b8e81ed5f71839df6d47b1ee0df53f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import plac
import importlib
from pathlib import Path
from spacy.util import get_package_path
from spacy.compat import symlink_to
@plac.annotations(
lang=plac.Annotation(help='Language code'),
lang_path=plac.Annotation(help='Language path'))
def link_lang_spacy(lang... | 25.157895 | 75 | 0.623431 |
import os
import sys
import plac
import importlib
from pathlib import Path
from spacy.util import get_package_path
from spacy.compat import symlink_to
@plac.annotations(
lang=plac.Annotation(help='Language code'),
lang_path=plac.Annotation(help='Language path'))
def link_lang_spacy(lang, lang_path):
ori... | true | true |
f7274bcbf40683a5d160d96b2f06a72cde94327d | 4,927 | py | Python | backend/DankiBackEnd/settings.py | danielpassy/Translang-Deck | 60057dd4eecc929682bb5d154656380b05d040c5 | [
"MIT"
] | 1 | 2020-12-29T16:00:13.000Z | 2020-12-29T16:00:13.000Z | backend/DankiBackEnd/settings.py | danielpassy/Translang-Deck | 60057dd4eecc929682bb5d154656380b05d040c5 | [
"MIT"
] | 8 | 2020-12-08T23:20:01.000Z | 2021-01-28T22:23:22.000Z | backend/DankiBackEnd/settings.py | danielpassy/Translang-Deck | 60057dd4eecc929682bb5d154656380b05d040c5 | [
"MIT"
] | 1 | 2020-12-08T23:38:49.000Z | 2020-12-08T23:38:49.000Z | """
Django settings for DankiBackEnd project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from path... | 26.632432 | 114 | 0.635681 |
from pathlib import Path
from os import path, getcwd
import os
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
SECRET_KEY = os.environ.get(
"SECRET_KEY", "(ac&ri0xuv9_!o#$$=$g#po&mkasdasdqwejqpoweaqaky-glk+vi^^!ka9f8%+$7"
)
DEBUG = True
ALLOWED_HOSTS = ["translang.live", "www.translang.live... | true | true |
f7274bf22c6d405fafa87ecd7084bc1ec5559d84 | 4,583 | py | Python | examples/amac/fund_spider.py | acracker/ruia | b973a47270f72cc16344ac203c00ee4f6d835c04 | [
"MIT"
] | null | null | null | examples/amac/fund_spider.py | acracker/ruia | b973a47270f72cc16344ac203c00ee4f6d835c04 | [
"MIT"
] | null | null | null | examples/amac/fund_spider.py | acracker/ruia | b973a47270f72cc16344ac203c00ee4f6d835c04 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-01-17 13:49
# @Author : pang
# @File : fund.py
# @Software: PyCharm
import datetime
import os
import asyncio
import re
import logging
import time
import random
import aiohttp
from motor.motor_asyncio import AsyncIOMotorClient
from ruia import Request... | 40.201754 | 157 | 0.592625 |
import datetime
import os
import asyncio
import re
import logging
import time
import random
import aiohttp
from motor.motor_asyncio import AsyncIOMotorClient
from ruia import Request, Spider, Response
try:
from items import FundInfoItemV1
from settings import *
except ImportError:
import sys
sy... | true | true |
f7274c9f9d6c7bc1762947fcfb7aab6dfe8470bc | 687 | py | Python | profiles/models.py | Samyak-jain09/QnA | 5044a947b84834cfc36554053a18cc1b12ad0f0e | [
"MIT"
] | null | null | null | profiles/models.py | Samyak-jain09/QnA | 5044a947b84834cfc36554053a18cc1b12ad0f0e | [
"MIT"
] | null | null | null | profiles/models.py | Samyak-jain09/QnA | 5044a947b84834cfc36554053a18cc1b12ad0f0e | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from sorl.thumbnail import ImageField
# Create your models here.
class Profile(models.Model):
user= models.OneToOneField(
User,
on... | 24.535714 | 62 | 0.672489 | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from sorl.thumbnail import ImageField
class Profile(models.Model):
user= models.OneToOneField(
User,
on_delete=models.CASCADE,
... | true | true |
f7274dc7c0bed6089595d1474055de95254fbc71 | 13,661 | py | Python | pyzombie/Handler.py | lanhel/pyzombie | dba35d98152e5d99d4231ab9124727ae47b3bf72 | [
"Apache-2.0"
] | null | null | null | pyzombie/Handler.py | lanhel/pyzombie | dba35d98152e5d99d4231ab9124727ae47b3bf72 | [
"Apache-2.0"
] | 1 | 2019-12-30T19:30:01.000Z | 2019-12-30T19:30:29.000Z | pyzombie/Handler.py | lanhel/pyzombie | dba35d98152e5d99d4231ab9124727ae47b3bf72 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""pyzombie HTTP RESTful resource handler."""
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0.1'
__copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)"""
__license__ = ... | 33.982587 | 109 | 0.566284 |
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0.1'
__copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)"""
__license__ = """
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 ... | true | true |
f7274e486eedd05c1c6a0c85be46f9c9e766ce1c | 1,073 | py | Python | SimpleShadowsocksSubscribeServer/views/subscribe.py | TomCzHen/py4S | c07b0a05c798809ef95e8ef47e87c877b82358fd | [
"MIT"
] | 1 | 2019-06-05T16:05:28.000Z | 2019-06-05T16:05:28.000Z | SimpleShadowsocksSubscribeServer/views/subscribe.py | TomCzHen/py4S | c07b0a05c798809ef95e8ef47e87c877b82358fd | [
"MIT"
] | null | null | null | SimpleShadowsocksSubscribeServer/views/subscribe.py | TomCzHen/py4S | c07b0a05c798809ef95e8ef47e87c877b82358fd | [
"MIT"
] | null | null | null | import uuid
from sanic import response
from sanic.exceptions import abort
from sanic.request import Request
from sanic.views import HTTPMethodView as SanicHTTPView
from ..cache import cache
class SubscribeView(SanicHTTPView):
async def get(self, request: Request, uid: uuid):
token = request.args.get('t... | 26.825 | 82 | 0.59739 | import uuid
from sanic import response
from sanic.exceptions import abort
from sanic.request import Request
from sanic.views import HTTPMethodView as SanicHTTPView
from ..cache import cache
class SubscribeView(SanicHTTPView):
async def get(self, request: Request, uid: uuid):
token = request.args.get('t... | true | true |
f7274e9c19524a8d036639345aeb06261fec049e | 5,177 | py | Python | tests/unit_tests/test_data_photon.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 262 | 2018-08-09T21:27:03.000Z | 2022-03-24T05:02:10.000Z | tests/unit_tests/test_data_photon.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 753 | 2018-08-03T15:26:57.000Z | 2022-03-29T23:54:48.000Z | tests/unit_tests/test_data_photon.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 196 | 2018-08-06T13:41:14.000Z | 2022-03-29T20:47:12.000Z | #!/usr/bin/env python
from collections.abc import Mapping, Callable
import os
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import openmc.data
@pytest.fixture(scope='module')
def elements_endf():
"""Dictionary of element ENDF data indexed by atomic symbol."""
endf_data = os.e... | 33.836601 | 85 | 0.66525 |
from collections.abc import Mapping, Callable
import os
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import openmc.data
@pytest.fixture(scope='module')
def elements_endf():
endf_data = os.environ['OPENMC_ENDF_DATA']
elements = {'H': 1, 'O': 8, 'Al': 13, 'Cu': 29, 'Ag': 47, ... | true | true |
f7274ee40debdeaa4b9393203cab8d398b64d837 | 756 | py | Python | v_python/conftest.py | spcartman/selenium_full_course | 673f25dcf2340c0c14666c7a91f774fd7659f0b1 | [
"MIT"
] | null | null | null | v_python/conftest.py | spcartman/selenium_full_course | 673f25dcf2340c0c14666c7a91f774fd7659f0b1 | [
"MIT"
] | null | null | null | v_python/conftest.py | spcartman/selenium_full_course | 673f25dcf2340c0c14666c7a91f774fd7659f0b1 | [
"MIT"
] | null | null | null | import pytest
import json
from os import path
from fixture.fixture import Fixture
with open(path.join(path.dirname(path.abspath(__file__)), 'config.json')) as f:
config = json.load(f)
@pytest.fixture(scope="session")
def app(request):
fixture = Fixture(admin_root=config['admin']['url'],
... | 34.363636 | 79 | 0.611111 | import pytest
import json
from os import path
from fixture.fixture import Fixture
with open(path.join(path.dirname(path.abspath(__file__)), 'config.json')) as f:
config = json.load(f)
@pytest.fixture(scope="session")
def app(request):
fixture = Fixture(admin_root=config['admin']['url'],
... | true | true |
f7275019da64b65a5d33210b547cf8cc8acaac87 | 1,094 | py | Python | bitoptions/widgets.py | amateja/django-bitoptions | 6e2d00d8b5d16c4a678a319c06313de6d2c75eda | [
"Unlicense"
] | 3 | 2016-03-16T03:11:01.000Z | 2016-12-31T06:20:57.000Z | bitoptions/widgets.py | amateja/django-bitoptions | 6e2d00d8b5d16c4a678a319c06313de6d2c75eda | [
"Unlicense"
] | 6 | 2018-06-12T12:40:22.000Z | 2018-06-18T09:46:46.000Z | bitoptions/widgets.py | amateja/django-bitoptions | 6e2d00d8b5d16c4a678a319c06313de6d2c75eda | [
"Unlicense"
] | null | null | null | from django import forms
from .utils import number2powers, BitOptions
class BitOptionsWidget(forms.CheckboxSelectMultiple):
"""
Default BitOptionsField widget to present every option (bit) as checkbox.
"""
def value_from_datadict(self, data, files, name):
"""
Given a dictionary of da... | 34.1875 | 79 | 0.606947 | from django import forms
from .utils import number2powers, BitOptions
class BitOptionsWidget(forms.CheckboxSelectMultiple):
def value_from_datadict(self, data, files, name):
return sum(map(int, super(BitOptionsWidget, self).value_from_datadict(
data, files, name)))
def render(self, name... | true | true |
f72753101e10bb8565a1a21aa5043b6b642088a5 | 2,482 | py | Python | sdk/python/pulumi_azure_native/network/v20180601/get_virtual_network_gateway_learned_routes.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180601/get_virtual_network_gateway_learned_routes.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180601/get_virtual_network_gateway_learned_routes.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 37.044776 | 183 | 0.711523 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetVirtualNetworkGatewayLearnedRoutesResult',
'AwaitableGetVirtualNetworkGatewayLearnedRoutesResult',
'get_virtual_netwo... | true | true |
f727542bee6fa712929c024c3afa8e0aad944e62 | 1,255 | py | Python | imaging_db/database/dataset.py | czbiohub/imagingDB | 1b1a58df3dbc94a43fb842cad198fb6c1c833326 | [
"MIT"
] | 5 | 2018-11-07T15:37:41.000Z | 2020-05-27T10:29:02.000Z | imaging_db/database/dataset.py | czbiohub/imagingDB | 1b1a58df3dbc94a43fb842cad198fb6c1c833326 | [
"MIT"
] | 39 | 2018-11-07T21:06:42.000Z | 2019-09-30T21:33:31.000Z | imaging_db/database/dataset.py | czbiohub/imagingDB | 1b1a58df3dbc94a43fb842cad198fb6c1c833326 | [
"MIT"
] | 2 | 2019-11-04T22:25:04.000Z | 2020-11-04T04:13:20.000Z | # coding=utf-8
from datetime import datetime
from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, DateTime
from imaging_db.database.base import Base
def _serial_to_date_time(dataset_serial):
substrs = dataset_serial.split("-")
date_time = datetime(int(substrs[1]), # year
... | 32.179487 | 83 | 0.620717 |
from datetime import datetime
from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, DateTime
from imaging_db.database.base import Base
def _serial_to_date_time(dataset_serial):
substrs = dataset_serial.split("-")
date_time = datetime(int(substrs[1]),
int(substrs[2]... | true | true |
f7275494b8cb9e77d969fcf6476d10ca21e0e71f | 3,818 | py | Python | salt/sdb/confidant.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | salt/sdb/confidant.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2019-09-06T13:57:28.000Z | 2019-09-06T13:57:28.000Z | salt/sdb/confidant.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
An SDB module for getting credentials from confidant.
Configuring the Confidant module
================================
The module can be configured via sdb in the minion config:
.. code-block:: yaml
confidant:
driver: confidant
# The URL of the confidant web service
url: '... | 29.828125 | 79 | 0.678104 |
from __future__ import absolute_import
import logging
import copy
try:
import confidant.client
import confidant.formatter
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
log = logging.getLogger(__name__)
__virtualname__ = 'confidant'
def __virtual__():
if HAS_LIBS:
return __vi... | true | true |
f72755a1c07aa293fbde7de86964d0198d4ff90b | 2,102 | py | Python | hair_seg/evaluate.py | eric91sanchez/hair_seg | 4f688daac0ec4ea906ff0462ae51634293e35447 | [
"MIT"
] | 4 | 2021-03-04T05:57:45.000Z | 2022-02-15T17:40:57.000Z | hair_seg/evaluate.py | vadik6666/hair-seg | 4f688daac0ec4ea906ff0462ae51634293e35447 | [
"MIT"
] | 4 | 2021-06-08T22:43:59.000Z | 2022-03-12T00:51:40.000Z | hair_seg/evaluate.py | vadik6666/hair_seg | 4f688daac0ec4ea906ff0462ae51634293e35447 | [
"MIT"
] | null | null | null | """
Evaluate
"""
import re
import math
import datetime
import random
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from loss import iou_loss, HairMattingLoss, acc_loss, F1_loss
from utils import create_multi_figure
USE_CUDA = torch.cuda.is_a... | 26.948718 | 73 | 0.62274 |
import re
import math
import datetime
import random
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from loss import iou_loss, HairMattingLoss, acc_loss, F1_loss
from utils import create_multi_figure
USE_CUDA = torch.cuda.is_available()
DEVICE... | true | true |
f72755d6fecdb1531c133393712bc30acc965025 | 5,519 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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.412281 | 196 | 0.673854 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineRespo... | true | true |
f727572624c9b1104e87598335f97c84bacafded | 842 | py | Python | src/testing/migrations/0006_auto_20210617_1656.py | DiceNameIsMy/testing_sitev2 | c973f796bd1bd7cfcfc53298a3884b92d2a36d27 | [
"MIT"
] | 1 | 2021-06-29T09:47:25.000Z | 2021-06-29T09:47:25.000Z | src/testing/migrations/0006_auto_20210617_1656.py | DiceNameIsMy/testing_sitev2 | c973f796bd1bd7cfcfc53298a3884b92d2a36d27 | [
"MIT"
] | null | null | null | src/testing/migrations/0006_auto_20210617_1656.py | DiceNameIsMy/testing_sitev2 | c973f796bd1bd7cfcfc53298a3884b92d2a36d27 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-17 10:56
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testing', '0005_useranswer_is_correct'),
]
operations = [
migrations.AddField(
model_name='usertestresult',
... | 28.066667 | 99 | 0.599762 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testing', '0005_useranswer_is_correct'),
]
operations = [
migrations.AddField(
model_name='usertestresult',
name='end_time',
field=mode... | true | true |
f72757698a249ebc1ea831e90b3b83ef1660ea9a | 3,589 | py | Python | google/cloud/recommender/v1beta1/recommender-v1beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/recommender/v1beta1/recommender-v1beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/recommender/v1beta1/recommender-v1beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 26.984962 | 96 | 0.627751 |
import os
import pathlib
import shutil
import subprocess
import sys
import nox
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="u... | true | true |
f727578d6163bc38fe54684ae5660bc222bf771a | 9,991 | py | Python | improver_tests/between_thresholds/test_between_thresholds.py | pnijhara/improver | 5961a6fab9a79cd63a943eff07bf79d4e5f0ff03 | [
"BSD-3-Clause"
] | null | null | null | improver_tests/between_thresholds/test_between_thresholds.py | pnijhara/improver | 5961a6fab9a79cd63a943eff07bf79d4e5f0ff03 | [
"BSD-3-Clause"
] | null | null | null | improver_tests/between_thresholds/test_between_thresholds.py | pnijhara/improver | 5961a6fab9a79cd63a943eff07bf79d4e5f0ff03 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 44.404444 | 88 | 0.624362 |
import unittest
import iris
import numpy as np
from iris.tests import IrisTest
from improver.between_thresholds import OccurrenceBetweenThresholds
from ..set_up_test_cubes import set_up_percentile_cube, set_up_probability_cube
class Test_process(IrisTest):
def setUp(self):
... | true | true |
f72759c1213da47f3d4defce97fc37be89c0f650 | 142 | py | Python | service_app/service_app/doctype/service/test_service.py | NahomAraya/Erpnext-App | 4648aa95b1b6ebf4ef9f80c2c02dbeb22277531d | [
"MIT"
] | null | null | null | service_app/service_app/doctype/service/test_service.py | NahomAraya/Erpnext-App | 4648aa95b1b6ebf4ef9f80c2c02dbeb22277531d | [
"MIT"
] | null | null | null | service_app/service_app/doctype/service/test_service.py | NahomAraya/Erpnext-App | 4648aa95b1b6ebf4ef9f80c2c02dbeb22277531d | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Appman and Contributors
# See license.txt
# import frappe
import unittest
class TestService(unittest.TestCase):
pass
| 15.777778 | 45 | 0.774648 |
import unittest
class TestService(unittest.TestCase):
pass
| true | true |
f72759c8061e47306fba82f635b426668b33c208 | 2,918 | py | Python | modules/swar/doc/splatted_prod.py | brycelelbach/nt2 | 73d7e8dd390fa4c8d251c6451acdae65def70e0b | [
"BSL-1.0"
] | 1 | 2022-03-24T03:35:10.000Z | 2022-03-24T03:35:10.000Z | modules/swar/doc/splatted_prod.py | brycelelbach/nt2 | 73d7e8dd390fa4c8d251c6451acdae65def70e0b | [
"BSL-1.0"
] | null | null | null | modules/swar/doc/splatted_prod.py | brycelelbach/nt2 | 73d7e8dd390fa4c8d251c6451acdae65def70e0b | [
"BSL-1.0"
] | null | null | null | [ ## this file was manually modified by jt
{
'functor' : {
'arity' : '1',
'call_types' : [],
'ret_arity' : '0',
'rturn' : {
'default' : 'T',
},
'special' : ['swar'],
'simd_types' : ['real_'],
'type_defs' : [],
't... | 38.906667 | 90 | 0.331391 | [ ty' : '1',
'call_types' : [],
'ret_arity' : '0',
'rturn' : {
'default' : 'T',
},
'special' : ['swar'],
'simd_types' : ['real_'],
'type_defs' : [],
'types' : ['real_'],
},
'info' : 'manually modified',
'unit' : ... | true | true |
f7275a40150b0c0246d5e22711d983f8a33d9abc | 1,585 | py | Python | tests/service/watcher/test_util.py | vinifmor/guapow | 59a9a1e6706bacbcb3d4bbc762ff9264d5e6f582 | [
"Zlib"
] | 7 | 2021-10-06T17:02:13.000Z | 2022-03-22T10:45:23.000Z | tests/service/watcher/test_util.py | vinifmor/guapow | 59a9a1e6706bacbcb3d4bbc762ff9264d5e6f582 | [
"Zlib"
] | 2 | 2022-03-16T11:20:54.000Z | 2022-03-24T13:54:49.000Z | tests/service/watcher/test_util.py | vinifmor/guapow | 59a9a1e6706bacbcb3d4bbc762ff9264d5e6f582 | [
"Zlib"
] | null | null | null | from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch, AsyncMock, call
from guapow import __app_name__
from guapow.service.watcher import util
class MapProcessesTest(IsolatedAsyncioTestCase):
@patch(f'{__app_name__}.service.watcher.util.async_syscall', side_effect=[(0, " 1 # a \n 2 # b \n... | 49.53125 | 141 | 0.683912 | from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch, AsyncMock, call
from guapow import __app_name__
from guapow.service.watcher import util
class MapProcessesTest(IsolatedAsyncioTestCase):
@patch(f'{__app_name__}.service.watcher.util.async_syscall', side_effect=[(0, " 1 # a \n 2 # b \n... | true | true |
f7275ca4a9614ae34d5dae69713b06a583c3d368 | 179 | py | Python | posts/forms.py | Kelit/My_blog | 891f082ac6b7a02ffbc8d106168cb0fd017ba3ef | [
"Apache-2.0"
] | null | null | null | posts/forms.py | Kelit/My_blog | 891f082ac6b7a02ffbc8d106168cb0fd017ba3ef | [
"Apache-2.0"
] | null | null | null | posts/forms.py | Kelit/My_blog | 891f082ac6b7a02ffbc8d106168cb0fd017ba3ef | [
"Apache-2.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField
class PostForm(FlaskForm):
title = StringField('Заголовок')
body = TextAreaField('Текст')
| 22.375 | 46 | 0.77095 | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField
class PostForm(FlaskForm):
title = StringField('Заголовок')
body = TextAreaField('Текст')
| true | true |
f7275ccef7ac1443c9619306e2735d5ade2696fa | 64 | py | Python | ptfims/__init__.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | ptfims/__init__.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | ptfims/__init__.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .ptfimages import *
| 21.333333 | 38 | 0.84375 | from __future__ import absolute_import
from .ptfimages import *
| true | true |
f7275d33269d0a2ea63c7f66122d5786bb653174 | 870 | py | Python | macWall.py | mathematics128/WinDD_Packaged_Wall | ec136adcf75e3f9c456149b995e2c0744bfe3c61 | [
"MIT"
] | null | null | null | macWall.py | mathematics128/WinDD_Packaged_Wall | ec136adcf75e3f9c456149b995e2c0744bfe3c61 | [
"MIT"
] | null | null | null | macWall.py | mathematics128/WinDD_Packaged_Wall | ec136adcf75e3f9c456149b995e2c0744bfe3c61 | [
"MIT"
] | null | null | null | from os import system, listdir
from PIL import Image
num = int(input('请输入你想生成的缩略图的长: ') )
for pic in listdir('.'):
if pic[-4:] == '.jpg':
tmp_pic = pic[:-4] + '.png'
temp_pic = pic[:-4] + '.bmp'
system('ffmpeg -i ' + pic + ' -vf scale=' + str(num) + ':-1 ' + tmp_pic)
system... | 33.461538 | 108 | 0.514943 | from os import system, listdir
from PIL import Image
num = int(input('请输入你想生成的缩略图的长: ') )
for pic in listdir('.'):
if pic[-4:] == '.jpg':
tmp_pic = pic[:-4] + '.png'
temp_pic = pic[:-4] + '.bmp'
system('ffmpeg -i ' + pic + ' -vf scale=' + str(num) + ':-1 ' + tmp_pic)
system... | true | true |
f7275daebdad04b10427a7fe30165f0dd0fc3904 | 533 | py | Python | root/messages.py | FilmyFather/TG-RenameBot | ae5e21c0da7c869c989a4ab7e1c79305f2ad3b61 | [
"MIT"
] | 46 | 2021-05-30T14:35:48.000Z | 2022-02-25T09:58:12.000Z | root/messages.py | FilmyFather/TG-RenameBot | ae5e21c0da7c869c989a4ab7e1c79305f2ad3b61 | [
"MIT"
] | 4 | 2021-08-10T14:11:52.000Z | 2021-12-30T17:59:28.000Z | root/messages.py | FilmyFather/TG-RenameBot | ae5e21c0da7c869c989a4ab7e1c79305f2ad3b61 | [
"MIT"
] | 102 | 2021-05-30T14:11:33.000Z | 2022-03-30T06:36:31.000Z | class Translation(object):
START_TEXT = "**I'm a Rename and Convert Bot\nJust send me any media to change file name.\nUse /help command for more details **"
######################
HELP_USER = """**>>Send File/Video\n>>Select desired Option\n>>And Done wait for it to process files**"""
DOWNLOAD_MSG = "**... | 53.3 | 134 | 0.634146 | class Translation(object):
START_TEXT = "**I'm a Rename and Convert Bot\nJust send me any media to change file name.\nUse /help command for more details **"
######################
HELP_USER = """**>>Send File/Video\n>>Select desired Option\n>>And Done wait for it to process files**"""
DOWNLOAD_MSG = "**... | true | true |
f7275dd92e798d7446dcdaf64a7b23e1afc7ec27 | 86,823 | py | Python | phriky_units/test_cps_units_checker.py | unl-nimbus-lab/phriky-units | 16c8cdd91de0899411b139e5a94fcb4ea8104ad2 | [
"MIT"
] | 22 | 2017-07-18T09:39:34.000Z | 2021-09-16T09:41:03.000Z | phriky_units/test_cps_units_checker.py | unl-nimbus-lab/phriky-units | 16c8cdd91de0899411b139e5a94fcb4ea8104ad2 | [
"MIT"
] | 9 | 2016-09-04T13:33:15.000Z | 2018-01-05T22:39:03.000Z | phriky_units/test_cps_units_checker.py | unl-nimbus-lab/phriky-units | 16c8cdd91de0899411b139e5a94fcb4ea8104ad2 | [
"MIT"
] | 4 | 2016-12-07T16:34:57.000Z | 2019-04-03T06:51:55.000Z | #!/usr/local/bin/python
import sys
# sys.path.append('/Users/jore/courses/NIMBUS/RESEARCH/CPS_TYPES/cps_units/')
import unittest
from detect_physical_unit_inconsistencies import CPSUnitsChecker
from unit_error_types import UnitErrorTypes
from unit_error import UnitError
import os
global_debug = False
global_debug_verb... | 52.588128 | 212 | 0.685176 |
import sys
import unittest
from detect_physical_unit_inconsistencies import CPSUnitsChecker
from unit_error_types import UnitErrorTypes
from unit_error import UnitError
import os
global_debug = False
global_debug_verbose = False
global_debug_AST = False
class TestStringMethods(unittest.TestCase):
def ... | true | true |
f7275de79abc81f51af3a3242318153f50472d2c | 1,465 | py | Python | app/rooms/examples/eg003_export_data_from_room/controller.py | olegliubimov/code-examples-python | 7af8c58138a9dd0f3b0be12eff1768ae23e449d3 | [
"MIT"
] | 21 | 2020-05-13T21:08:44.000Z | 2022-02-18T01:32:16.000Z | app/rooms/examples/eg003_export_data_from_room/controller.py | olegliubimov/code-examples-python | 7af8c58138a9dd0f3b0be12eff1768ae23e449d3 | [
"MIT"
] | 8 | 2020-11-23T09:28:04.000Z | 2022-02-02T12:04:08.000Z | app/rooms/examples/eg003_export_data_from_room/controller.py | olegliubimov/code-examples-python | 7af8c58138a9dd0f3b0be12eff1768ae23e449d3 | [
"MIT"
] | 26 | 2020-05-12T22:20:01.000Z | 2022-03-09T10:57:27.000Z | from docusign_rooms import RoomsApi
from flask import session, request
from ...utils import create_rooms_api_client
class Eg003Controller:
@staticmethod
def get_args():
"""Get required session and request arguments"""
return {
"account_id": session["ds_account_id"], # Represents ... | 31.170213 | 89 | 0.627304 | from docusign_rooms import RoomsApi
from flask import session, request
from ...utils import create_rooms_api_client
class Eg003Controller:
@staticmethod
def get_args():
return {
"account_id": session["ds_account_id"],
"access_token": session["ds_access_token"],
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.