hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ae4ce30378892033c398ef027500637f9cdd6d14 | 6,002 | py | Python | lib/rucio/daemons/sonar_v3/distribution/distribution_daemon.py | efajardo/rucio | 460f394715568b937584ef671382b2b93add1758 | [
"Apache-2.0"
] | 1 | 2018-02-27T08:03:41.000Z | 2018-02-27T08:03:41.000Z | lib/rucio/daemons/sonar_v3/distribution/distribution_daemon.py | efajardo/rucio | 460f394715568b937584ef671382b2b93add1758 | [
"Apache-2.0"
] | null | null | null | lib/rucio/daemons/sonar_v3/distribution/distribution_daemon.py | efajardo/rucio | 460f394715568b937584ef671382b2b93add1758 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... | 40.554054 | 149 | 0.649783 |
533443cfdcbcdd3a7d798d60d2d1bbae16e53482 | 460 | py | Python | cactus/tests/data/skeleton/plugins/page_context.py | jacobmarshall-etc/Cactus | 398ed4a1f57d0aa84fe3b297d7d27d0703683637 | [
"BSD-3-Clause"
] | 2 | 2016-07-07T17:43:33.000Z | 2017-09-11T00:33:19.000Z | cactus/tests/data/skeleton/plugins/page_context.py | jacobmarshall-etc/Cactus | 398ed4a1f57d0aa84fe3b297d7d27d0703683637 | [
"BSD-3-Clause"
] | null | null | null | cactus/tests/data/skeleton/plugins/page_context.py | jacobmarshall-etc/Cactus | 398ed4a1f57d0aa84fe3b297d7d27d0703683637 | [
"BSD-3-Clause"
] | null | null | null | #coding:utf-8
def preBuildPage(page, context, data):
"""
Updates the context of the page to include: the page itself as {{ CURRENT_PAGE }}
"""
# This will run for each page that Cactus renders.
# Any changes you make to context will be passed to the template renderer for this page.
extra = {
... | 27.058824 | 92 | 0.658696 |
29bb7f4fa6f583091b750a46e26f4702f6a3ec7a | 6,335 | py | Python | webpage/grammar_checker.py | JoeLanzi/CSCI_5030_TEAM_1 | 155da86076e440bb049b926d6c967bdcecc90c7b | [
"MIT"
] | null | null | null | webpage/grammar_checker.py | JoeLanzi/CSCI_5030_TEAM_1 | 155da86076e440bb049b926d6c967bdcecc90c7b | [
"MIT"
] | 2 | 2021-12-08T01:55:37.000Z | 2021-12-08T21:21:49.000Z | webpage/grammar_checker.py | JoeLanzi/CSCI_5030_TEAM_1 | 155da86076e440bb049b926d6c967bdcecc90c7b | [
"MIT"
] | 3 | 2021-09-10T21:39:44.000Z | 2021-10-01T21:59:18.000Z | #%% IMPORT DATA
import pickle
import itertools
from collections import Counter
import math
class Checker():
def __init__(self, language = 'en-US') -> None:
self.language = language
self.DICTIONARY,self.BIGRAMS, self.LETTERS = [],[],[]
self.repeated_words, self.correct_grammar = [],[]
... | 40.870968 | 135 | 0.602526 |
066474cb35da6ad5fa489390257e34c006a99b8a | 2,336 | py | Python | nova/scheduler/filters/disk_filter.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/disk_filter.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/disk_filter.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 39.59322 | 79 | 0.673373 |
0d20bdb2b2f70f0043a479a09a34f4233e90f956 | 12,646 | py | Python | bot/cogs/reminders.py | ayushsherpa111/bot | ecc58f739c153c56dc0db09954e5b378bb1a9873 | [
"MIT"
] | null | null | null | bot/cogs/reminders.py | ayushsherpa111/bot | ecc58f739c153c56dc0db09954e5b378bb1a9873 | [
"MIT"
] | null | null | null | bot/cogs/reminders.py | ayushsherpa111/bot | ecc58f739c153c56dc0db09954e5b378bb1a9873 | [
"MIT"
] | null | null | null | import asyncio
import logging
import random
import textwrap
import typing as t
from datetime import datetime, timedelta
from operator import itemgetter
import discord
from dateutil.parser import isoparse
from dateutil.relativedelta import relativedelta
from discord.ext.commands import Cog, Context, group
from bot.bot... | 36.549133 | 117 | 0.614186 |
52faea1d1ddaeb7572bdd0a2a94863c3f9a693dc | 244 | py | Python | research/deeplab/test_train.py | smurpheus/models | 89486a1a84d2ccda7753e8cf25549069d8cb7ef6 | [
"Apache-2.0"
] | null | null | null | research/deeplab/test_train.py | smurpheus/models | 89486a1a84d2ccda7753e8cf25549069d8cb7ef6 | [
"Apache-2.0"
] | null | null | null | research/deeplab/test_train.py | smurpheus/models | 89486a1a84d2ccda7753e8cf25549069d8cb7ef6 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from deeplab import flag_converter
#f = flag_converter.FlagConverter()
#tf.app.flags = f
from deeplab import train
t = train.Trainer("/home/dwarfeus/gdrive/Coding/DartsData/trainconfig.json")
t.do_training()
print("asd") | 30.5 | 76 | 0.790984 |
3115d55ee1a8ce36d759b5cbcbdf1e49f38c8548 | 1,595 | py | Python | rabbitai/views/css_templates.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | null | null | null | rabbitai/views/css_templates.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | null | null | null | rabbitai/views/css_templates.py | psbsgic/rabbitai | 769e120ba605d56ac076f810a549c38dac410c8e | [
"Apache-2.0"
] | 1 | 2021-07-09T16:29:50.000Z | 2021-07-09T16:29:50.000Z | from flask_appbuilder.api import expose
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_appbuilder.security.decorators import has_access
from flask_babel import lazy_gettext as _
from rabbitai import is_feature_enabled
from rabbitai.constants import MODEL_VIEW_RW_METHOD_PERMISSION_MAP, Rout... | 32.55102 | 79 | 0.763009 |
d9bddf1406e09158684818b7dc68f6b69a1cafcf | 2,629 | py | Python | docs/conf.py | rodrigo-arenas/scikit-pipes | 636349f2417669088e3a8817b0579ec6e2d6a006 | [
"MIT"
] | 1 | 2021-11-27T00:00:44.000Z | 2021-11-27T00:00:44.000Z | docs/conf.py | rodrigo-arenas/scikit-pipes | 636349f2417669088e3a8817b0579ec6e2d6a006 | [
"MIT"
] | null | null | null | docs/conf.py | rodrigo-arenas/scikit-pipes | 636349f2417669088e3a8817b0579ec6e2d6a006 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 30.929412 | 79 | 0.690377 |
1438bd814481575044610677453f220e93af66ad | 787 | py | Python | examples/crons/likers/hashtag_geotag_liker.py | sudoguy/instapro | 7a7003cf07fdf992037641f61beee8815be8a0b1 | [
"Apache-2.0"
] | 1 | 2021-03-19T06:48:00.000Z | 2021-03-19T06:48:00.000Z | examples/crons/likers/hashtag_geotag_liker.py | sudoguy/instapro | 7a7003cf07fdf992037641f61beee8815be8a0b1 | [
"Apache-2.0"
] | null | null | null | examples/crons/likers/hashtag_geotag_liker.py | sudoguy/instapro | 7a7003cf07fdf992037641f61beee8815be8a0b1 | [
"Apache-2.0"
] | null | null | null | import sys
import time
from random import random
from tqdm import tqdm
sys.path.append('../../../')
from instabot import User, Sender
main_username = "ohld" # this user should be logged to instapro earlier
send = Sender(main_username)
with open("hashtags.txt", "r", encoding='utf-8') as f:
hashtags = [x.strip() f... | 29.148148 | 74 | 0.703939 |
a30d25839b75efe6208c80df58bfbb1451911118 | 1,641 | py | Python | src/project/users/schema_users.py | Kaushal1011/django-ecommerce-graphql | 42f081189dd0465ac909f630b4638a5abd46417d | [
"MIT"
] | null | null | null | src/project/users/schema_users.py | Kaushal1011/django-ecommerce-graphql | 42f081189dd0465ac909f630b4638a5abd46417d | [
"MIT"
] | null | null | null | src/project/users/schema_users.py | Kaushal1011/django-ecommerce-graphql | 42f081189dd0465ac909f630b4638a5abd46417d | [
"MIT"
] | null | null | null | import graphene
from graphene import ObjectType
from graphene_django import DjangoObjectType
from django.contrib.auth import get_user_model
from django.contrib.auth import authenticate
class UserType(DjangoObjectType):
class Meta:
model = get_user_model()
class CreateUser(graphene.Mutation):
user =... | 24.492537 | 84 | 0.670323 |
a00c7d93d8aaa5f99292e6695b9d7faa67a41a8f | 861 | py | Python | IMS/ims_users/admin.py | AyushPaudel/Inventory-Management-System | 04e57b0d02b1b7cade992b959569e750ca339c8e | [
"MIT"
] | 2 | 2021-09-01T13:00:24.000Z | 2021-11-19T12:16:52.000Z | IMS/ims_users/admin.py | aadarshadhakalg/Inventory-Management-System-1 | 075ec49b9d4abebb7d9a0b150a6cb70f6cbf5144 | [
"MIT"
] | null | null | null | IMS/ims_users/admin.py | aadarshadhakalg/Inventory-Management-System-1 | 075ec49b9d4abebb7d9a0b150a6cb70f6cbf5144 | [
"MIT"
] | 1 | 2022-01-07T05:50:08.000Z | 2022-01-07T05:50:08.000Z | from django.contrib import admin
from .models import imsUser,Payment
from .forms import imsUserCreationForm
from django.contrib.auth.admin import UserAdmin
# Register your models here.
admin.site.register(Payment)
class imsUserAdmin(UserAdmin):
model = imsUser
add_form = imsUserCreationForm
fieldsets = (
... | 23.916667 | 47 | 0.423926 |
43d1dc13d5df2dcba12c26cd49d9499b3a3c24ee | 14,196 | py | Python | python/ccxt/async/acx.py | August-Ghost/ccxt | 886c596ffde611b5a92cb5b6e3788ff010324c74 | [
"MIT"
] | 2 | 2018-03-08T20:17:22.000Z | 2021-06-01T23:36:26.000Z | python/ccxt/async/acx.py | August-Ghost/ccxt | 886c596ffde611b5a92cb5b6e3788ff010324c74 | [
"MIT"
] | null | null | null | python/ccxt/async/acx.py | August-Ghost/ccxt | 886c596ffde611b5a92cb5b6e3788ff010324c74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import OrderNotFound
class acx (Exchange):
def describe(self):
return self.deep_extend(super(acx, self).describe(), {
'id': 'acx',
'name': 'ACX',... | 38.893151 | 212 | 0.496407 |
a77bbfba43f2b144e78549749c14c4dd59fb8e7d | 11,389 | py | Python | src/toast/tests/mpi.py | jrs584/toast | c0e2a9296348a22075271236457ad5c23713af82 | [
"BSD-2-Clause"
] | 29 | 2017-03-23T04:51:32.000Z | 2022-02-10T13:17:42.000Z | src/toast/tests/mpi.py | jrs584/toast | c0e2a9296348a22075271236457ad5c23713af82 | [
"BSD-2-Clause"
] | 362 | 2016-05-06T18:26:35.000Z | 2022-03-30T16:39:46.000Z | src/toast/tests/mpi.py | jrs584/toast | c0e2a9296348a22075271236457ad5c23713af82 | [
"BSD-2-Clause"
] | 37 | 2016-05-20T09:31:03.000Z | 2022-02-24T13:56:27.000Z | # Copyright (c) 2015-2020 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
import sys
import time
import warnings
from unittest.signals import registerResult
from unittest import TestCase
from unitte... | 34.407855 | 88 | 0.546931 |
2b8345bfba006e6326f8b0d7f5ac6be25002181e | 502 | py | Python | Python-Django-2016/Python/Clase2/fechas.py | juandc/platzi-courses | 27443bdb40a35100b9c839e2d598bc3cf4e43032 | [
"MIT"
] | 3 | 2017-09-14T23:14:21.000Z | 2018-03-22T20:07:37.000Z | Python-Django-2016/Python/Clase2/fechas.py | juandc/platzi-courses | 27443bdb40a35100b9c839e2d598bc3cf4e43032 | [
"MIT"
] | null | null | null | Python-Django-2016/Python/Clase2/fechas.py | juandc/platzi-courses | 27443bdb40a35100b9c839e2d598bc3cf4e43032 | [
"MIT"
] | null | null | null | import datetime
from dateutil.relativedelta import relativedelta
six_months = datetime.date.today() + relativedelta( months = +6 )
print six_months
def mt():
datime1="March 7 2009 7:30pm EST"
formatting = "%B %d %Y %I:%M%p "
datime2 = datime1[:-3] # format can't handle "EST" for some reason
tdelta = datetime.... | 26.421053 | 68 | 0.695219 |
ee6c1838980791a09fc8436f85c21d4d18557276 | 45,966 | py | Python | pandas/core/internals/array_manager.py | rendner/pandas | 47494a48edf25d5a49b0fb5b896b454c15c83595 | [
"BSD-3-Clause"
] | 1 | 2019-11-01T08:44:40.000Z | 2019-11-01T08:44:40.000Z | pandas/core/internals/array_manager.py | sdrees/pandas | bef454f0893efe2fa5e49317635f89c03467d16e | [
"BSD-3-Clause"
] | null | null | null | pandas/core/internals/array_manager.py | sdrees/pandas | bef454f0893efe2fa5e49317635f89c03467d16e | [
"BSD-3-Clause"
] | null | null | null | """
Experimental manager based on storing a collection of 1D arrays
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Callable,
Hashable,
TypeVar,
)
import numpy as np
from pandas._libs import (
NaT,
algos as libalgos,
lib,
)
from pandas._typing import (
... | 32.879828 | 88 | 0.566897 |
52f82f754446de73d9f23ec71c53824da45d9b78 | 16,555 | py | Python | src/data_loader.py | PeterZs/hmd | c7c78981e631dd19d5409e5df52146a23a65f649 | [
"MIT"
] | 1 | 2019-06-19T16:19:15.000Z | 2019-06-19T16:19:15.000Z | src/data_loader.py | PeterZs/hmd | c7c78981e631dd19d5409e5df52146a23a65f649 | [
"MIT"
] | null | null | null | src/data_loader.py | PeterZs/hmd | c7c78981e631dd19d5409e5df52146a23a65f649 | [
"MIT"
] | null | null | null | from torch.utils.data.dataset import Dataset
import numpy as np
import PIL.Image
import random
import json
import pickle
import torchvision.transforms as transforms
from utility import center_crop
#==============================================================================
# data loader for joint train/test
#======... | 36.953125 | 83 | 0.5164 |
c7c7bd913b4a75251f6ab5d1f22c58e7ddcb2040 | 1,031 | py | Python | src/openclsim/core/locatable.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | null | null | null | src/openclsim/core/locatable.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | null | null | null | src/openclsim/core/locatable.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | null | null | null | """Component to locate the simulation objects."""
import pyproj
import shapely.geometry
class Locatable:
"""
Something with a geometry (geojson format).
Can be a point as well as a polygon
Parameters
----------
geometry : Shapely object
"""
def __init__(self, geometry, *args, **kwarg... | 27.131579 | 86 | 0.622696 |
99d7745caf90888be72b8db26fd176eeda85deab | 1,134 | py | Python | Script.py | AniketWithPython/PDF-Merger | c5ec47b5ee332ff476a64a8857e159a853f33735 | [
"FSFAP"
] | 1 | 2022-02-13T17:15:50.000Z | 2022-02-13T17:15:50.000Z | Script.py | AniketWithPython/PDF-Merger | c5ec47b5ee332ff476a64a8857e159a853f33735 | [
"FSFAP"
] | null | null | null | Script.py | AniketWithPython/PDF-Merger | c5ec47b5ee332ff476a64a8857e159a853f33735 | [
"FSFAP"
] | null | null | null | import os
import subprocess as s
from PyPDF4 import PdfFileMerger
print('''PDF merger for Microsoft(R) Windows™
(C)Aniket Maity
All Rights Reserved
This PDF merger will merge the given pdf files
Note: Make sure to name the PDF files properly so as to merge them in the correct order.
''')
input("Press Ent... | 22.235294 | 89 | 0.640212 |
c2c1de5654324f6058ff36d89a6f5bb6a2ebb200 | 1,966 | py | Python | proj01_ifelse/proj01.py | Belal555/VSA | 1da9657a87bc9c9abb6db1bb35ae82df1dd59b0a | [
"MIT"
] | null | null | null | proj01_ifelse/proj01.py | Belal555/VSA | 1da9657a87bc9c9abb6db1bb35ae82df1dd59b0a | [
"MIT"
] | null | null | null | proj01_ifelse/proj01.py | Belal555/VSA | 1da9657a87bc9c9abb6db1bb35ae82df1dd59b0a | [
"MIT"
] | null | null | null | # Name:
# Date:
# proj01: A Simple Program
# Part I:
# This program asks the user for his/her name and grade.
#Then, it prints out a sentence that says the number of years until they graduate.
# Part II:
# This program asks the user for his/her name and birth month.
# Then, it prints a sentence that says the number ... | 28.492754 | 89 | 0.641404 |
9bb5be98a9271f99f1837528684d07b262745fea | 222 | py | Python | Medium/Mirror Reflection.py | Koushik-Deb/LeetCode | de2e3f6222f89d42ef716076b4846173d01f69a2 | [
"MIT"
] | null | null | null | Medium/Mirror Reflection.py | Koushik-Deb/LeetCode | de2e3f6222f89d42ef716076b4846173d01f69a2 | [
"MIT"
] | null | null | null | Medium/Mirror Reflection.py | Koushik-Deb/LeetCode | de2e3f6222f89d42ef716076b4846173d01f69a2 | [
"MIT"
] | 3 | 2021-07-29T14:06:48.000Z | 2021-07-29T16:54:13.000Z | class Solution:
def mirrorReflection(self, p: int, q: int) -> int:
from fractions import gcd
g = gcd(p, q)
p = (p / g) % 2
q = (q / g) % 2
return 1 if p and q else 0 if p else 2 | 27.75 | 54 | 0.495495 |
d104c93108fb1559d15a8e597b75b2d91cead664 | 4,824 | py | Python | plotly/graph_objs/scatterpolar/selected/_textfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2018-07-16T01:51:47.000Z | 2018-07-16T01:51:47.000Z | plotly/graph_objs/scatterpolar/selected/_textfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/graph_objs/scatterpolar/selected/_textfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class Textfont(BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
Sets the text font color of selected points.
The 'color' property is a color and may be specified as:
- A h... | 36 | 75 | 0.556385 |
36927aba14490533ce5e40d69ef295d096fc12e0 | 462 | py | Python | corelib/__init__.py | guillaume-florent/corelib | 9e25b862b5eaf1fe1a9b68af070a743184f992ba | [
"MIT"
] | 1 | 2018-05-05T02:11:59.000Z | 2018-05-05T02:11:59.000Z | corelib/__init__.py | guillaume-florent/corelib | 9e25b862b5eaf1fe1a9b68af070a743184f992ba | [
"MIT"
] | null | null | null | corelib/__init__.py | guillaume-florent/corelib | 9e25b862b5eaf1fe1a9b68af070a743184f992ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
r"""corelib __init__ file"""
from __future__ import unicode_literals
#
# Core library
__name__ = "corelib"
__description__ = "Core library"
__version__ = "0.2.16"
__author__ = "Guillaume Florent"
__author_email__ = "guillaume.florent@tutanota.com"
__license__ = 'MIT'
__url__ =... | 23.1 | 93 | 0.757576 |
30f506de70eb8efce6fae8b2a6d0c0a26b464c66 | 7,849 | py | Python | tests/jax_jit_test.py | joshuagornall/jax | c97cd0a526c12ad81988fd58c1c66df4ddd71813 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-01-17T19:04:49.000Z | 2021-01-17T19:04:49.000Z | tests/jax_jit_test.py | joshuagornall/jax | c97cd0a526c12ad81988fd58c1c66df4ddd71813 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-06-08T22:19:08.000Z | 2021-06-08T22:19:49.000Z | tests/jax_jit_test.py | joshuagornall/jax | c97cd0a526c12ad81988fd58c1c66df4ddd71813 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.37619 | 79 | 0.717161 |
2f2d7cb8a016d2786c5ee1e53a2c0664ed26852a | 596 | py | Python | hijos/treasure/migrations/0003_auto_20180518_1900.py | mbaragiola/hijos | 8f08fc482631a4151c25e7d6cdcafa5eb61e9006 | [
"BSD-3-Clause"
] | 2 | 2021-01-17T05:11:04.000Z | 2021-01-17T05:20:45.000Z | hijos/treasure/migrations/0003_auto_20180518_1900.py | mbaragiola/hijos | 8f08fc482631a4151c25e7d6cdcafa5eb61e9006 | [
"BSD-3-Clause"
] | null | null | null | hijos/treasure/migrations/0003_auto_20180518_1900.py | mbaragiola/hijos | 8f08fc482631a4151c25e7d6cdcafa5eb61e9006 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.4 on 2018-05-18 19:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('treasure', '0002_auto_20180424_1249'),
]
operations = [
migrations.AlterField(
model_name='period',
name='begin',
... | 24.833333 | 81 | 0.583893 |
90c4ae4e246a7ba318bc522504ef398f50c95fa9 | 2,452 | py | Python | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/compute_vm_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/compute_vm_properties_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/compute_vm_properties_py3.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 ... | 44.581818 | 188 | 0.645595 |
ed691ec2869ed7e56544ebfbcd10373ddec2da0f | 1,863 | py | Python | conftest.py | lsmo-epfl/aiida-qeq | e11d8d644a0ab9f205ded9e5ceed07820872d0bf | [
"MIT"
] | 3 | 2019-03-17T08:21:38.000Z | 2020-09-28T03:32:25.000Z | conftest.py | ltalirz/aiida-qeq | e11d8d644a0ab9f205ded9e5ceed07820872d0bf | [
"MIT"
] | 8 | 2018-11-21T16:06:20.000Z | 2020-12-09T13:56:11.000Z | conftest.py | ltalirz/aiida-qeq | e11d8d644a0ab9f205ded9e5ceed07820872d0bf | [
"MIT"
] | 2 | 2018-11-21T16:56:46.000Z | 2019-08-14T07:38:32.000Z | # -*- coding: utf-8 -*-
"""
For pytest
initialise a test database and profile
"""
# pylint: disable=missing-function-docstring
import pytest
from aiida.plugins import DataFactory
import aiida_qeq.data as data
from tests import TEST_DIR, DATA_DIR
pytest_plugins = ['aiida.manage.tests.pytest_fixtures', 'aiida_testing.m... | 31.05 | 114 | 0.690821 |
ee200262dfcd3adf3e555eecc8117b511eec7790 | 259 | py | Python | exostriker/lib/pyqtgraph/exporters/__init__.py | exoristos21/exostriker | 85cee34744bcd6e960dcdffc9140bb1d9107982e | [
"MIT"
] | 69 | 2020-01-06T13:31:06.000Z | 2022-03-29T11:23:14.000Z | exostriker/lib/pyqtgraph/exporters/__init__.py | exoristos21/exostriker | 85cee34744bcd6e960dcdffc9140bb1d9107982e | [
"MIT"
] | 67 | 2019-11-30T14:45:05.000Z | 2022-03-14T20:26:06.000Z | exostriker/lib/pyqtgraph/exporters/__init__.py | exoristos21/exostriker | 85cee34744bcd6e960dcdffc9140bb1d9107982e | [
"MIT"
] | 13 | 2020-01-06T13:44:40.000Z | 2022-03-29T11:23:17.000Z | from .Exporter import Exporter
from .ImageExporter import *
from .SVGExporter import *
from .Matplotlib_ES import *
from .CSVExporter_TT import *
from .PrintExporter import *
from .HDF5Exporter import *
def listExporters():
return Exporter.Exporters[:]
| 21.583333 | 32 | 0.776062 |
ec2333011ef31a71b437bfc5aa8d9d1ca2c2d03d | 797 | py | Python | Booleans.py | belmiro-kunga/Curso-de-python | ce1c59c19aefbe789435c855b3fa950abb14bcae | [
"MIT"
] | null | null | null | Booleans.py | belmiro-kunga/Curso-de-python | ce1c59c19aefbe789435c855b3fa950abb14bcae | [
"MIT"
] | null | null | null | Booleans.py | belmiro-kunga/Curso-de-python | ce1c59c19aefbe789435c855b3fa950abb14bcae | [
"MIT"
] | null | null | null | #Booleans
"""
print(10 > 9)
print(10 == 9)
print( 10 < 9)
a = 300
b = 33000
if b > a:
print("b e maior que a")
else:
print("b e menor que a")
"""
"""
#A maioria dos valores são verdadeiros
x = "hello"
y = 15
print(bool(x))
print(bool(y))
####################################
"""
#Alguns valores são fal... | 10.486842 | 38 | 0.557089 |
f47ab1ac06fe07f5966fa80888b77bdfa1099d0a | 12,415 | py | Python | tests/test_climax.py | miguelgrinberg/clear | 4061dc976a2f150f570910a9661575358c5c2e85 | [
"MIT"
] | 41 | 2016-01-25T16:48:50.000Z | 2021-10-18T13:25:13.000Z | tests/test_climax.py | miguelgrinberg/clear | 4061dc976a2f150f570910a9661575358c5c2e85 | [
"MIT"
] | 5 | 2016-03-08T20:42:46.000Z | 2020-02-19T10:19:54.000Z | tests/test_climax.py | miguelgrinberg/clear | 4061dc976a2f150f570910a9661575358c5c2e85 | [
"MIT"
] | 6 | 2016-05-18T15:19:10.000Z | 2020-03-10T18:02:49.000Z | from __future__ import print_function
import argparse
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import unittest
try:
from unittest import mock
except ImportError:
import mock
import sys
import coverage
cov = coverage.coverage(branch=True, source=['climax'])
cov.st... | 30.883085 | 78 | 0.556424 |
de94971778058713d6f29241b10d960ff21cca61 | 261 | py | Python | main.py | TAG-Epic/speedcord-template | 34b0b172ef5c9ece35d6342722870179d7b9fe6f | [
"MIT"
] | 1 | 2021-01-06T16:32:15.000Z | 2021-01-06T16:32:15.000Z | main.py | TAG-Epic/speedcord-template | 34b0b172ef5c9ece35d6342722870179d7b9fe6f | [
"MIT"
] | null | null | null | main.py | TAG-Epic/speedcord-template | 34b0b172ef5c9ece35d6342722870179d7b9fe6f | [
"MIT"
] | null | null | null | """
Created by Epic at 9/5/20
"""
import speedcord
from speedcord.http import Route
from os import environ as env
from logging import basicConfig, DEBUG
client = speedcord.Client(intents=512)
basicConfig(level=DEBUG)
client.token = env["TOKEN"]
client.run()
| 17.4 | 38 | 0.762452 |
8e3ad40abe613e6b4879699dbddaa6203be3cdef | 4,998 | py | Python | scanpy/preprocessing/recipes.py | umangv/scanpy | 94c3dc55d8dfbc45f809fd276beccc96cfcc57b4 | [
"BSD-3-Clause"
] | 1 | 2021-05-15T22:58:43.000Z | 2021-05-15T22:58:43.000Z | scanpy/preprocessing/recipes.py | umangv/scanpy | 94c3dc55d8dfbc45f809fd276beccc96cfcc57b4 | [
"BSD-3-Clause"
] | 1 | 2018-10-19T21:31:31.000Z | 2018-10-29T21:21:14.000Z | scanpy/preprocessing/recipes.py | umangv/scanpy | 94c3dc55d8dfbc45f809fd276beccc96cfcc57b4 | [
"BSD-3-Clause"
] | 2 | 2019-12-26T06:50:49.000Z | 2021-08-18T18:02:32.000Z | """Preprocessing recipes from the literature
"""
from . import simple as pp
from .. import logging as logg
def recipe_weinreb17(adata, log=True, mean_threshold=0.01, cv_threshold=2,
n_pcs=50, svd_solver='randomized', random_state=0,
copy=False):
"""Normalization and filt... | 42 | 96 | 0.659864 |
f3cdb0dc32294a302b6f9912e68faa0643ef9bec | 12,097 | py | Python | examples/1d/plot_classif.py | eugenium/kymatio | 21d51faf2f14b65c38cf846718715d2fb203a25d | [
"BSD-3-Clause"
] | null | null | null | examples/1d/plot_classif.py | eugenium/kymatio | 21d51faf2f14b65c38cf846718715d2fb203a25d | [
"BSD-3-Clause"
] | null | null | null | examples/1d/plot_classif.py | eugenium/kymatio | 21d51faf2f14b65c38cf846718715d2fb203a25d | [
"BSD-3-Clause"
] | null | null | null | """
Classification of spoken digit recordings
=========================================
In this example we use the 1D scattering transform to represent spoken digits,
which we then classify using a simple classifier. This shows that 1D scattering
representations are useful for this type of problem.
This dataset is au... | 38.525478 | 80 | 0.571464 |
e1a7108b36f564942fa925d0a624b4926df6ce22 | 3,171 | py | Python | salt/engines/__init__.py | BuildOps/salt | 20ddd4c29dde31baff36bbd81082db76d22f080a | [
"Apache-2.0"
] | null | null | null | salt/engines/__init__.py | BuildOps/salt | 20ddd4c29dde31baff36bbd81082db76d22f080a | [
"Apache-2.0"
] | null | null | null | salt/engines/__init__.py | BuildOps/salt | 20ddd4c29dde31baff36bbd81082db76d22f080a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Initialize the engines system. This plugin system allows for
complex services to be encapsulated within the salt plugin environment
'''
# Import python libs
from __future__ import absolute_import
import multiprocessing
import logging
# Import salt libs
import salt
import salt.loader
import ... | 31.088235 | 96 | 0.561968 |
0159dccb2790fef1d568e51b597d9f39e77b147a | 483 | py | Python | code/03-skimage-images/HighIntensity.py | rahulisaac/image-processing | 595e702e337729844625cd6d5d8252fcc9b63a6a | [
"CC-BY-4.0"
] | 2 | 2021-01-10T17:24:07.000Z | 2021-01-11T09:34:42.000Z | code/03-skimage-images/HighIntensity.py | rahulisaac/image-processing | 595e702e337729844625cd6d5d8252fcc9b63a6a | [
"CC-BY-4.0"
] | null | null | null | code/03-skimage-images/HighIntensity.py | rahulisaac/image-processing | 595e702e337729844625cd6d5d8252fcc9b63a6a | [
"CC-BY-4.0"
] | null | null | null | """
* Python script to ignore low intensity pixels in an image.
*
* usage: python HighIntensity.py <filename>
"""
import sys
import skimage.io
import skimage.viewer
# read input image, based on filename parameter
image = skimage.io.imread(fname=sys.argv[1])
# display original image
viewer = skimage.viewer.ImageViewer... | 21 | 59 | 0.757764 |
5ac87335de2bddae0025bf4185a9ee201d42adeb | 5,122 | py | Python | HW11/Q1/main.py | ammoradi/computer-vision-course-exercises | 3b562c8c6688c1c0cfad21e9e920a8cc5e90a9a7 | [
"MIT"
] | null | null | null | HW11/Q1/main.py | ammoradi/computer-vision-course-exercises | 3b562c8c6688c1c0cfad21e9e920a8cc5e90a9a7 | [
"MIT"
] | null | null | null | HW11/Q1/main.py | ammoradi/computer-vision-course-exercises | 3b562c8c6688c1c0cfad21e9e920a8cc5e90a9a7 | [
"MIT"
] | null | null | null | # import the necessary packages
from HodaDatasetReader import read_hoda_cdb, read_hoda_dataset
from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import AveragePooling2D
from keras.preprocessing.image import ImageDataGenerator
from keras.layers.core import ... | 35.818182 | 98 | 0.745607 |
57dc4b5863389ba6d135c9ebfe5fced330e49ed4 | 31,554 | py | Python | cfgov/paying_for_college/models/disclosures.py | alexandersirris/consumerfinance.gov | 611bd5d88188177759faa1fbc63ae57deb88cfbd | [
"CC0-1.0"
] | null | null | null | cfgov/paying_for_college/models/disclosures.py | alexandersirris/consumerfinance.gov | 611bd5d88188177759faa1fbc63ae57deb88cfbd | [
"CC0-1.0"
] | null | null | null | cfgov/paying_for_college/models/disclosures.py | alexandersirris/consumerfinance.gov | 611bd5d88188177759faa1fbc63ae57deb88cfbd | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import json
import smtplib
from collections import OrderedDict
from csv import writer as csw
from string import Template
from django.contrib.postgres.fields import JSONField
from django.core.mail import send_mail
from django.db import models
import requests
# Our database has... | 36.520833 | 80 | 0.588166 |
3bbf91dd2ee91e8398c02973fab580c857ea075c | 6,375 | py | Python | test/functional/bipdersig-p2p.py | GpunionProject/Gpuniontoken | 6288a3707a67d41f38b7d71941fee303f9ee1d2a | [
"MIT"
] | 2 | 2018-07-05T16:30:07.000Z | 2018-07-16T06:34:57.000Z | test/functional/bipdersig-p2p.py | GpunionProject/Gpuniontoken | 6288a3707a67d41f38b7d71941fee303f9ee1d2a | [
"MIT"
] | 1 | 2018-07-26T08:46:11.000Z | 2018-07-28T23:34:36.000Z | test/functional/bipdersig-p2p.py | GpunionProject/Gpuniontoken | 6288a3707a67d41f38b7d71941fee303f9ee1d2a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Gpunion Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP66 (DER SIG).
Test that the DERSIG soft-fork ... | 40.605096 | 100 | 0.667294 |
dac287910ca642c5527968f807403410a8647b22 | 370 | py | Python | src/python/dart/model/api_key.py | RetailMeNotSandbox/dart | 58a05f56c04fadd6741501262d92aeb143cd2f2e | [
"MIT"
] | 18 | 2016-03-03T19:10:21.000Z | 2021-07-14T22:37:35.000Z | src/python/dart/model/api_key.py | RetailMeNotSandbox/dart | 58a05f56c04fadd6741501262d92aeb143cd2f2e | [
"MIT"
] | 62 | 2016-04-11T15:17:23.000Z | 2017-09-08T17:18:53.000Z | src/python/dart/model/api_key.py | RetailMeNotSandbox/dart | 58a05f56c04fadd6741501262d92aeb143cd2f2e | [
"MIT"
] | 15 | 2016-03-03T15:38:34.000Z | 2019-03-27T19:33:08.000Z | from dart.model.base import BaseModel, dictable
@dictable
class ApiKey(BaseModel):
def __init__(self, id, user_id, api_key, api_secret):
"""
:type user_id: str
:type api_key: str
:type api_secret: str
"""
self.id = id
self.user_id = user_id
self.api_k... | 24.666667 | 57 | 0.6 |
a4c22169cfedf1d48be995521781a69b5f4a0ef7 | 5,959 | py | Python | v1_0/api/core.py | ehenneken/adsrex | c026b3a01ec9255895c1afe20ac6c0527bd7374f | [
"MIT"
] | null | null | null | v1_0/api/core.py | ehenneken/adsrex | c026b3a01ec9255895c1afe20ac6c0527bd7374f | [
"MIT"
] | null | null | null | v1_0/api/core.py | ehenneken/adsrex | c026b3a01ec9255895c1afe20ac6c0527bd7374f | [
"MIT"
] | null | null | null | from ..user_roles import anonymous_user, authenticated_user, bumblebee_user
import time
def test_resources():
# /v1/resources doesn't exist (but I think it should exist)
r = anonymous_user.get('/resources')
assert r.status_code == 404
# the response is organized from the perspective of the AD... | 32.922652 | 89 | 0.527102 |
36a3533ed47783cf55262fdb3d5ee849c00a7b28 | 307 | py | Python | exerciciosPython/Mundo1GB/ex023.py | gutembergdomingos13/ExerciciosPhyton | 67e046d3ed91d1c10d8227bc5a89735ed6a0abff | [
"MIT"
] | null | null | null | exerciciosPython/Mundo1GB/ex023.py | gutembergdomingos13/ExerciciosPhyton | 67e046d3ed91d1c10d8227bc5a89735ed6a0abff | [
"MIT"
] | null | null | null | exerciciosPython/Mundo1GB/ex023.py | gutembergdomingos13/ExerciciosPhyton | 67e046d3ed91d1c10d8227bc5a89735ed6a0abff | [
"MIT"
] | null | null | null | numero = int(input("Informe um numero: "))
u = numero // 1 % 10
d = numero // 10 % 10
c = numero // 100 % 10
m = numero // 1000 % 10
print("\nAnalisando o numero {}".format(numero))
print("Unidade: {}".format(u))
print("Dezena: {}".format(d))
print("Centena: {}".format(c))
print("Milhar: {}".format(m))
| 21.928571 | 48 | 0.599349 |
ffd96673ecd7bd6d7122a86529389cd44905bb19 | 659 | py | Python | loops_part2/vacation.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | loops_part2/vacation.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | loops_part2/vacation.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | 1 | 2022-01-14T17:12:44.000Z | 2022-01-14T17:12:44.000Z | money_for_vacation = float(input())
saved_money = float(input())
days = 1
spending_days_count = 0
while True:
command = input()
money = float(input())
if command == "save":
saved_money += money
spending_days_count = 0
if saved_money >= money_for_vacation:
print(f"You sav... | 24.407407 | 58 | 0.562974 |
1dfb7a5b5c10d6d09b7dd55a8071df2051653d4f | 8,248 | py | Python | test/functional/listsinceblock.py | gradinkov/pigeoncoin | 1a4f420f344d229d37514b570e92cae358ea06d7 | [
"MIT"
] | 49 | 2018-03-24T13:56:00.000Z | 2021-04-15T04:29:17.000Z | test/functional/listsinceblock.py | gradinkov/pigeoncoin | 1a4f420f344d229d37514b570e92cae358ea06d7 | [
"MIT"
] | 18 | 2018-03-22T20:12:34.000Z | 2020-05-14T03:09:37.000Z | test/functional/listsinceblock.py | gradinkov/pigeoncoin | 1a4f420f344d229d37514b570e92cae358ea06d7 | [
"MIT"
] | 64 | 2018-03-27T00:17:34.000Z | 2021-12-02T21:41:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2017 The Pigeon Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listsincelast RPC."""
from test_framework.test_fra... | 33.124498 | 106 | 0.580141 |
d074bd41fe025e786ce23df88460893744218435 | 1,487 | py | Python | ticketus/mailgw/utils.py | sjkingo/ticketus | 90f2781af9418e9e2c6470ca50c9a6af9ce098ff | [
"BSD-2-Clause"
] | 3 | 2019-02-09T10:52:55.000Z | 2021-09-19T14:14:36.000Z | ticketus/mailgw/utils.py | sjkingo/ticketus | 90f2781af9418e9e2c6470ca50c9a6af9ce098ff | [
"BSD-2-Clause"
] | null | null | null | ticketus/mailgw/utils.py | sjkingo/ticketus | 90f2781af9418e9e2c6470ca50c9a6af9ce098ff | [
"BSD-2-Clause"
] | 3 | 2018-03-04T18:05:02.000Z | 2021-09-19T14:14:38.000Z | import email
from email_reply_parser import EmailReplyParser
from ticketus.core.models import Ticket, Comment
from ticketus.core.utils import get_user
def clean_email_body(raw_body):
"""
Cleans an email's plain text body by stripping out any signatures.
"""
s = EmailReplyParser.read(raw_body)
retu... | 30.979167 | 88 | 0.686617 |
deedc1a31e90cb674001b714a54fe9f8e654539c | 164 | py | Python | app/other.py | penguins-dstu/ttk-control-server | 313df0afa5ecf1595eebdbff4567b146719a35e6 | [
"MIT"
] | null | null | null | app/other.py | penguins-dstu/ttk-control-server | 313df0afa5ecf1595eebdbff4567b146719a35e6 | [
"MIT"
] | null | null | null | app/other.py | penguins-dstu/ttk-control-server | 313df0afa5ecf1595eebdbff4567b146719a35e6 | [
"MIT"
] | null | null | null | from app import app
def allowed_file(filename):
return '.' in filename and \
filename.rsplit('.', 1)[1].lower() in app.config['ALLOWED_EXTENSIONS']
| 27.333333 | 81 | 0.658537 |
381b92414345a320aaf3c9456c45f32a67e820ed | 15,843 | py | Python | package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py | neuromusic/PartSeg | a4edff1b9fbe55eb7f5e1fc8b5b3f8e730b35caf | [
"BSD-3-Clause"
] | 15 | 2020-03-21T03:27:56.000Z | 2022-03-21T07:46:39.000Z | package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py | neuromusic/PartSeg | a4edff1b9fbe55eb7f5e1fc8b5b3f8e730b35caf | [
"BSD-3-Clause"
] | 479 | 2019-10-27T22:57:22.000Z | 2022-03-30T12:48:14.000Z | package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py | neuromusic/PartSeg | a4edff1b9fbe55eb7f5e1fc8b5b3f8e730b35caf | [
"BSD-3-Clause"
] | 5 | 2020-02-05T14:25:02.000Z | 2021-12-21T03:44:52.000Z | import typing
from contextlib import suppress
import numpy as np
import pandas as pd
from napari import Viewer
from napari.layers import Image as NapariImage
from napari.layers import Labels, Layer
from napari.utils.notifications import show_info
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QDialog,
... | 39.410448 | 116 | 0.676576 |
8e095905850ddbcf5570ed99cee4c69711f2b65d | 2,678 | py | Python | languages/en_US.py | JakeWharton/is_awesome | ba3ce1e0445be3b29b9c3eb228ace31b1854eea6 | [
"Apache-2.0"
] | 6 | 2015-11-04T01:24:22.000Z | 2021-01-30T01:13:50.000Z | languages/en_US.py | JakeWharton/is_awesome | ba3ce1e0445be3b29b9c3eb228ace31b1854eea6 | [
"Apache-2.0"
] | null | null | null | languages/en_US.py | JakeWharton/is_awesome | ba3ce1e0445be3b29b9c3eb228ace31b1854eea6 | [
"Apache-2.0"
] | null | null | null | # Site
s_pass = 'Pass'
s_fail = 'Fail'
s_unknown = 'Unknown'
s_skipped = 'Skipped'
s_compliance = 'Compliance'
s_attribute = 'Attribute'
s_requirement = 'Requirement'
s_value = 'Value'
s_missing = 'Missing'
s_invalidres = 'Invalid resolution'
s_or = 'or'
s_and ... | 35.236842 | 301 | 0.683346 |
0b69b832f09c5e3b3cf6907c974f1f7687f0088e | 7,753 | py | Python | tests/examples/imc.py | apanda/modeling | e032abd413bb3325ad6e5995abadeef74314f383 | [
"BSD-3-Clause"
] | 3 | 2017-08-30T05:24:11.000Z | 2021-02-25T12:17:19.000Z | tests/examples/imc.py | apanda/modeling | e032abd413bb3325ad6e5995abadeef74314f383 | [
"BSD-3-Clause"
] | null | null | null | tests/examples/imc.py | apanda/modeling | e032abd413bb3325ad6e5995abadeef74314f383 | [
"BSD-3-Clause"
] | 2 | 2017-11-15T07:00:48.000Z | 2020-12-13T17:29:03.000Z | import components
import z3
from itertools import repeat
def IMC(nservers):
nodes = ['n%d'%i for i in xrange(nservers)]
servers = list(nodes)
nodes.append('lb1_o')
nodes.append('lb2_o')
lbs_out = ['lb1_o', 'lb2_o']
nodes.append('lb1_i')
nodes.append('lb2_i')
lbs_in = ['lb1_i', 'lb2_i']... | 34.923423 | 85 | 0.639623 |
565d90724a9e0996361f6fb45240c4ea4cd2bbe3 | 111 | py | Python | test/test_load.py | HiroakiMikami/python-config | 2c03ad28f18f4e6ac63f9fd0a3dbf6ee6992d5cc | [
"MIT"
] | null | null | null | test/test_load.py | HiroakiMikami/python-config | 2c03ad28f18f4e6ac63f9fd0a3dbf6ee6992d5cc | [
"MIT"
] | null | null | null | test/test_load.py | HiroakiMikami/python-config | 2c03ad28f18f4e6ac63f9fd0a3dbf6ee6992d5cc | [
"MIT"
] | null | null | null | import io
from python_config import load
def test_load():
assert load(io.StringIO("x = 1")) == {"x": 1}
| 13.875 | 49 | 0.63964 |
95757f2cca9115172ad6905ff9982f2f5a7985b9 | 8,663 | py | Python | tests/grid_warper_test.py | tdml13/NiftyNet | b35fa19ca307e81d229e2fe8269a417724833da2 | [
"Apache-2.0"
] | 1,403 | 2017-08-30T11:49:45.000Z | 2022-03-31T11:44:05.000Z | tests/grid_warper_test.py | tdml13/NiftyNet | b35fa19ca307e81d229e2fe8269a417724833da2 | [
"Apache-2.0"
] | 360 | 2017-10-03T15:33:53.000Z | 2021-03-17T06:27:38.000Z | tests/grid_warper_test.py | tdml13/NiftyNet | b35fa19ca307e81d229e2fe8269a417724833da2 | [
"Apache-2.0"
] | 464 | 2017-09-13T20:56:32.000Z | 2022-02-11T20:33:47.000Z | from __future__ import absolute_import, print_function, division
import numpy as np
import tensorflow as tf
from niftynet.layer.grid_warper import AffineGridWarperLayer
from niftynet.layer.grid_warper import AffineWarpConstraints
from niftynet.layer.grid_warper import _create_affine_features
from tests.niftynet_testc... | 39.557078 | 80 | 0.555581 |
4e28e95a4a86d1a840640abf727847ac50305787 | 414 | py | Python | django_admin_env_notice/context_processors.py | jmorenoamor/django-admin-env-notice | a4a9e0921bafd3cdee8151ea10626af62da1500f | [
"MIT"
] | null | null | null | django_admin_env_notice/context_processors.py | jmorenoamor/django-admin-env-notice | a4a9e0921bafd3cdee8151ea10626af62da1500f | [
"MIT"
] | null | null | null | django_admin_env_notice/context_processors.py | jmorenoamor/django-admin-env-notice | a4a9e0921bafd3cdee8151ea10626af62da1500f | [
"MIT"
] | null | null | null | from django.conf import settings
def from_settings(request):
return {
'ENVIRONMENT_NAME': getattr(settings, 'ENVIRONMENT_NAME', None),
'ENVIRONMENT_COLOR': getattr(settings, 'ENVIRONMENT_COLOR', None),
'ENVIRONMENT_ADMIN_SELECTOR': getattr(
settings, 'ENVIRONMENT_ADMIN_SELECTOR... | 34.5 | 75 | 0.690821 |
2403a9bb8317cd692f7b1253736b41f37d4beed2 | 14,448 | py | Python | clouddq/integration/dataplex/clouddq_dataplex.py | GoogleCloudPlatform/cloud-data-quality | c8a3e95c5150e2ee0fb9cabc8e34ef861e4bf349 | [
"Apache-2.0"
] | 94 | 2021-03-19T17:35:19.000Z | 2022-03-30T02:03:31.000Z | clouddq/integration/dataplex/clouddq_dataplex.py | GoogleCloudPlatform/cloud-data-quality | c8a3e95c5150e2ee0fb9cabc8e34ef861e4bf349 | [
"Apache-2.0"
] | 50 | 2021-04-03T10:06:09.000Z | 2022-03-16T08:37:53.000Z | clouddq/integration/dataplex/clouddq_dataplex.py | GoogleCloudPlatform/cloud-data-quality | c8a3e95c5150e2ee0fb9cabc8e34ef861e4bf349 | [
"Apache-2.0"
] | 16 | 2021-04-09T15:34:39.000Z | 2022-03-16T16:51:01.000Z | # Copyright 2021 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, ... | 39.692308 | 112 | 0.609012 |
27ac77115e67351baa3667bfed4f15288f4bcc58 | 4,816 | py | Python | tasks/lm/manager.py | etri-edgeai/nn-comp-discblock | 6e00a019c223508797ca91a7d5ffec7917b12c6d | [
"Apache-2.0"
] | 10 | 2021-11-19T06:24:51.000Z | 2022-02-09T15:44:00.000Z | tasks/lm/manager.py | etri-edgeai/nn-comp-discblock | 6e00a019c223508797ca91a7d5ffec7917b12c6d | [
"Apache-2.0"
] | 9 | 2021-10-01T11:06:27.000Z | 2021-12-23T02:10:52.000Z | tasks/lm/manager.py | etri-edgeai/nn-comp-discblock | 6e00a019c223508797ca91a7d5ffec7917b12c6d | [
"Apache-2.0"
] | 2 | 2021-09-14T04:08:36.000Z | 2021-11-19T06:24:54.000Z | import torch
import torchtext
import torch.nn as nn
import time
import math
def get_data(data_name, batch_size, bptt, device):
if data_name == "wikitext2":
train_iters, val_iters, test_iters = torchtext.datasets.WikiText2.iters(batch_size=batch_size, bptt_len=bptt, device=device)
elif data_name == "wik... | 43.781818 | 139 | 0.603613 |
2d898eee6b5161955f9a669c4a9b13bea125e0f1 | 4,394 | py | Python | venv/Lib/site-packages/pandas/tests/frame/methods/test_update.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/frame/methods/test_update.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/frame/methods/test_update.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | 1 | 2021-04-26T22:41:56.000Z | 2021-04-26T22:41:56.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Series, date_range
import pandas._testing as tm
class TestDataFrameUpdate:
def test_update_nan(self):
# #15593 #15617
# test 1
df1 = DataFrame({"A": [1.0, 2, 3], "B": date_range("2000", periods=... | 32.308824 | 89 | 0.49909 |
5e77780f84f96ec46abdb114cbec5386b246335a | 7,209 | py | Python | isthisipbad.py | jgamblin/isthisipbad | 15253998ef160612078f8389077ee8b1068a47d0 | [
"MIT"
] | 224 | 2015-05-11T19:26:37.000Z | 2022-03-21T10:08:19.000Z | isthisipbad.py | jgamblin/isthisipbad | 15253998ef160612078f8389077ee8b1068a47d0 | [
"MIT"
] | 14 | 2015-05-13T03:40:24.000Z | 2021-02-21T21:30:40.000Z | isthisipbad.py | jgamblin/isthisipbad | 15253998ef160612078f8389077ee8b1068a47d0 | [
"MIT"
] | 108 | 2015-05-11T20:56:27.000Z | 2022-02-15T11:22:18.000Z | import os
import sys
import urllib3
import argparse
import re
import socket
import dns
import warnings
from dns import resolver
from requests import get
warnings.filterwarnings("ignore", category=DeprecationWarning)
def color(text, color_code):
if sys.platform == "win32" and os.getenv("TERM") != "xterm":
... | 31.207792 | 99 | 0.597864 |
4336dfb54b7ca0ccffa2ae285fb87ac9b46816b7 | 52 | py | Python | ENTRY_MODULE/ConditionalStatements/LAB/03_Even_or_Odd.py | sleepychild/ProgramingBasicsPython | d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16 | [
"MIT"
] | null | null | null | ENTRY_MODULE/ConditionalStatements/LAB/03_Even_or_Odd.py | sleepychild/ProgramingBasicsPython | d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16 | [
"MIT"
] | 1 | 2022-01-15T10:33:56.000Z | 2022-01-15T10:33:56.000Z | ENTRY_MODULE/ConditionalStatements/LAB/03_Even_or_Odd.py | sleepychild/ProgramingBasicsPython | d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16 | [
"MIT"
] | null | null | null | print("even" if (int(input()) % 2) == 0 else "odd")
| 26 | 51 | 0.538462 |
c973f941212821b61ef262a9d10f8764f77743a6 | 8,368 | py | Python | tensorpack/tfutils/varmanip.py | brandontrabucco/tensorpack | 9d66052bf26cab02ba8bccb6932a3003af4b4206 | [
"Apache-2.0"
] | 2 | 2019-04-27T07:36:19.000Z | 2019-04-27T07:36:20.000Z | tensorpack/tfutils/varmanip.py | lkn123/tensorpack | d7a13cb74c9066bc791d7aafc3b744b60ee79a9f | [
"Apache-2.0"
] | null | null | null | tensorpack/tfutils/varmanip.py | lkn123/tensorpack | d7a13cb74c9066bc791d7aafc3b744b60ee79a9f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File: varmanip.py
import numpy as np
import os
import pprint
import six
import tensorflow as tf
from ..compat import tfv1
from ..utils import logger
from .common import get_op_tensor_name
__all__ = ['SessionUpdate', 'dump_session_params',
'load_chkpt_vars', 'save_chkpt_vars', 'ge... | 35.012552 | 118 | 0.613289 |
0aaa4ce0f641af42a77ce92fc66117e00e0a257f | 629 | py | Python | src/modificationrequests/api/urls.py | Zayn484/softForest-rest-api | 6ba80f738f2f00e938bc472b900c467d67dc4bc4 | [
"bzip2-1.0.6"
] | null | null | null | src/modificationrequests/api/urls.py | Zayn484/softForest-rest-api | 6ba80f738f2f00e938bc472b900c467d67dc4bc4 | [
"bzip2-1.0.6"
] | 5 | 2021-03-19T00:39:57.000Z | 2022-01-13T01:14:11.000Z | src/modificationrequests/api/urls.py | Zayn484/softforest-rest-api | 6ba80f738f2f00e938bc472b900c467d67dc4bc4 | [
"bzip2-1.0.6"
] | null | null | null | from django.urls import path, include, re_path
from .views import (
RequestCreateAPIView,
FileUploadView,
AttachedFileDownloadViewSet,
RequestViewSet
)
from rest_framework.routers import DefaultRouter
app_name = 'modificationrequests'
router = DefaultRouter()
router.register('', RequestViewSet)
router... | 26.208333 | 84 | 0.753577 |
5af5b4a6b1a0d80cfa658da80cd2362a81cfd8c2 | 5,197 | py | Python | hututoo/hututoo/settings.py | Shamsherocode/hututoo-web-app | b30de8d121cc15371c8e4a416a50f652e263d50f | [
"MIT"
] | null | null | null | hututoo/hututoo/settings.py | Shamsherocode/hututoo-web-app | b30de8d121cc15371c8e4a416a50f652e263d50f | [
"MIT"
] | null | null | null | hututoo/hututoo/settings.py | Shamsherocode/hututoo-web-app | b30de8d121cc15371c8e4a416a50f652e263d50f | [
"MIT"
] | null | null | null | """
Django settings for hututoo project.
Generated by 'django-admin startproject' using Django 2.0.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
impo... | 26.380711 | 95 | 0.6929 |
d48faeaa8bd187dacf8e3b3bca3b6440bbc9fe31 | 11,059 | py | Python | ninu-blockchain/BlockchainNodeRunner.py | prakashchhipa/NiNu-Blockchain-Solution | 9a58ed2e84bffb30fa9271094ad1ce55ecc41f63 | [
"Apache-2.0"
] | null | null | null | ninu-blockchain/BlockchainNodeRunner.py | prakashchhipa/NiNu-Blockchain-Solution | 9a58ed2e84bffb30fa9271094ad1ce55ecc41f63 | [
"Apache-2.0"
] | null | null | null | ninu-blockchain/BlockchainNodeRunner.py | prakashchhipa/NiNu-Blockchain-Solution | 9a58ed2e84bffb30fa9271094ad1ce55ecc41f63 | [
"Apache-2.0"
] | null | null | null | #!BlockchainNodeRunner Class
"""
This class serves as service API for each blockchain node. It is Flask based REST APIs provider which runs as server.
It exposes APIS forthe following:
1) Node Registration - This post API allows peer to peer node registration whereas each node manages its own copy of block chain
2... | 49.591928 | 186 | 0.600868 |
2dd144a741159ae53c1e6ff1a504772e653046e0 | 3,120 | py | Python | crawl/crawl/settings.py | Google1234/crawl-for-book | 037a08b5e260befe3fd675495b6384a32a72de7f | [
"Apache-2.0"
] | null | null | null | crawl/crawl/settings.py | Google1234/crawl-for-book | 037a08b5e260befe3fd675495b6384a32a72de7f | [
"Apache-2.0"
] | null | null | null | crawl/crawl/settings.py | Google1234/crawl-for-book | 037a08b5e260befe3fd675495b6384a32a72de7f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for crawl project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/t... | 34.285714 | 109 | 0.775962 |
60f3254591102d3627cbbf968072274a7d3d763a | 14,886 | py | Python | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/show_details_of_request_throttling_policy_v2_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/show_details_of_request_throttling_policy_v2_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/show_details_of_request_throttling_policy_v2_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowDetailsOfRequestThrottlingPolicyV2Response(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 31.944206 | 288 | 0.66136 |
36c3a5397a32ad0e070a3c4264358331e75aa57a | 891 | py | Python | python/common/rest.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | 3 | 2020-02-18T20:54:13.000Z | 2022-01-14T17:11:45.000Z | python/common/rest.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | 41 | 2020-03-19T19:00:51.000Z | 2022-03-05T02:12:18.000Z | python/common/rest.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | 6 | 2020-02-20T20:05:24.000Z | 2022-01-25T02:19:29.000Z | from flask import jsonify
import logging
def failed_validation(**args) -> tuple:
return _common_error_function(422, **args)
def server_error(**args) -> tuple:
# override the error string, we don't want to share too much
args['error_string'] = 'something went wrong'
return _common_error_function(500,... | 27 | 73 | 0.630752 |
b5c0060e70d6de05acae3f6996caed970cdf4413 | 28,425 | py | Python | easygl/prefabs/circle.py | overdev/easygl-0.1.0-alpha1 | c3ab70c272db670cbe4e79a99371d21da466d8a0 | [
"MIT"
] | null | null | null | easygl/prefabs/circle.py | overdev/easygl-0.1.0-alpha1 | c3ab70c272db670cbe4e79a99371d21da466d8a0 | [
"MIT"
] | null | null | null | easygl/prefabs/circle.py | overdev/easygl-0.1.0-alpha1 | c3ab70c272db670cbe4e79a99371d21da466d8a0 | [
"MIT"
] | null | null | null | # !/usr/bin/python
# -*- coding: utf-8 -*-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | 39.099037 | 152 | 0.608021 |
5683f8ed52d48db6fb28df56a92dd30a77b5d0b1 | 2,047 | py | Python | trader/batch/queuer.py | 9600dev/mmr | b08e63b7044f2b2061d8679b216822c82d309c86 | [
"Apache-2.0"
] | 12 | 2021-09-22T21:19:23.000Z | 2022-01-03T21:38:47.000Z | trader/batch/queuer.py | webclinic017/mmr | 9c385c027fcf8cf365e41726c7c5d2064f33c202 | [
"Apache-2.0"
] | null | null | null | trader/batch/queuer.py | webclinic017/mmr | 9c385c027fcf8cf365e41726c7c5d2064f33c202 | [
"Apache-2.0"
] | 3 | 2021-09-05T23:26:13.000Z | 2022-03-25T01:01:22.000Z | import sys
import os
import datetime as dt
from redis import Redis
from rq import Queue
from rq.job import Job
from typing import List, Optional, Dict, Callable, Union
class Queuer():
def __init__(self,
redis_queue: str = '',
redis_server_address: str = '127.0.0.1',
... | 30.552239 | 82 | 0.607719 |
0d12a6a26d1fa4ef46a292b924d78919a3bf96f6 | 26,061 | py | Python | rdflib/plugins/sparql/operators.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 1 | 2020-03-18T08:57:23.000Z | 2020-03-18T08:57:23.000Z | rdflib/plugins/sparql/operators.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 1 | 2022-03-17T16:46:04.000Z | 2022-03-17T16:46:04.000Z | rdflib/plugins/sparql/operators.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 2 | 2020-04-15T10:03:29.000Z | 2020-04-20T11:34:18.000Z | """
This contains evaluation functions for expressions
They get bound as instances-methods to the CompValue objects from parserutils
using setEvalFn
"""
import sys
import re
import math
import random
import uuid
import hashlib
import urllib2
from decimal import Decimal, ROUND_HALF_UP, InvalidOperation
import opera... | 25.80297 | 127 | 0.593492 |
e696229944f55df871da400bd65b7bcafbb06527 | 708 | py | Python | setup.py | azryn42/jlrpy | 8943dcb6a7f18b2f2c6c8b81f606386655055a95 | [
"MIT"
] | 66 | 2018-12-29T00:18:10.000Z | 2022-03-07T22:00:32.000Z | setup.py | azryn42/jlrpy | 8943dcb6a7f18b2f2c6c8b81f606386655055a95 | [
"MIT"
] | 55 | 2018-12-31T07:43:14.000Z | 2021-12-21T18:45:07.000Z | setup.py | azryn42/jlrpy | 8943dcb6a7f18b2f2c6c8b81f606386655055a95 | [
"MIT"
] | 30 | 2018-12-31T10:09:55.000Z | 2021-12-20T21:36:25.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jlrpy",
version="1.4.0",
author="Edvard",
author_email="edvard.holst@gmail.com",
description="Control your Jaguar I-Pace",
long_description=long_description,
long_description_cont... | 27.230769 | 54 | 0.641243 |
1e02b952e2a36b4964a8812d08dcf753007c0280 | 1,334 | py | Python | mmcv/image/misc.py | jinliwei1997/mmcv | f8d46df4a9fa32fb44d2e92a4ca5e7b26ee9cb79 | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | mmcv/image/misc.py | jinliwei1997/mmcv | f8d46df4a9fa32fb44d2e92a4ca5e7b26ee9cb79 | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | mmcv/image/misc.py | jinliwei1997/mmcv | f8d46df4a9fa32fb44d2e92a4ca5e7b26ee9cb79 | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | import numpy as np
import mmcv
try:
import torch
except ImportError:
torch = None
def tensor2imgs(tensor, mean=(0, 0, 0), std=(1, 1, 1), to_rgb=True):
"""Convert tensor to 3-channel images.
Args:
tensor (torch.Tensor): Tensor that contains multiple images, shape (
N, C, H, W).
... | 30.318182 | 77 | 0.612444 |
643c296af9214886a77de0e8c18df63e483ddeba | 510 | py | Python | dis_sdk_python_demo/list_stream_sample.py | Leonneoxie/huaweicloud-sdk-python-dis | b07c020438ddd54957d639c374aad9a7006703c9 | [
"Apache-2.0"
] | 2 | 2019-05-28T03:36:24.000Z | 2019-07-25T14:50:11.000Z | dis_sdk_python_demo/list_stream_sample.py | Leonneoxie/huaweicloud-sdk-python-dis | b07c020438ddd54957d639c374aad9a7006703c9 | [
"Apache-2.0"
] | 2 | 2018-07-13T02:49:46.000Z | 2021-03-15T02:01:07.000Z | dis_sdk_python_demo/list_stream_sample.py | Leonneoxie/huaweicloud-sdk-python-dis | b07c020438ddd54957d639c374aad9a7006703c9 | [
"Apache-2.0"
] | 6 | 2019-04-15T02:02:06.000Z | 2021-03-12T09:31:28.000Z | #!/usr/bin/python
# -*- coding:utf-8 -*-
from dis_sdk_python import *
start_stream_name = ""
def list_stream_test():
cli = disclient(endpoint='', ak='', sk='', projectid='', region='')
try:
r = cli.listStream(start_stream_name)
print(r.statusCode)
if IS_PYTHON2:
print(json... | 20.4 | 71 | 0.584314 |
07dcf5fbbacb02fa2c1a12caf534be362ff999cf | 3,565 | py | Python | interactive_widgets_mkdocs/prologue.py | h3ndrk/interactive-widgets-mkdocs | 8aa2477ed58be3053f23841676ac4fc194218e32 | [
"MIT"
] | null | null | null | interactive_widgets_mkdocs/prologue.py | h3ndrk/interactive-widgets-mkdocs | 8aa2477ed58be3053f23841676ac4fc194218e32 | [
"MIT"
] | null | null | null | interactive_widgets_mkdocs/prologue.py | h3ndrk/interactive-widgets-mkdocs | 8aa2477ed58be3053f23841676ac4fc194218e32 | [
"MIT"
] | null | null | null | import bs4
import mkdocs
import pathlib
import shlex
import typing
from .widget import Widget
class PrologueWidget(Widget):
def __init__(self, config: mkdocs.config.base.Config, url: pathlib.PurePosixPath, soup: bs4.BeautifulSoup, index: int, tag: bs4.element.Tag):
super().__init__(config, url, soup, in... | 40.511364 | 190 | 0.598036 |
54cd290de84cdb84750e25c588fd6c0033237944 | 138 | py | Python | text_summary/project_folder/Rawcode/directoryCheck.py | pdmorale/Summarization | b2e68b3ec7990ee6a20c9881cb5d2012cced0d57 | [
"MIT"
] | null | null | null | text_summary/project_folder/Rawcode/directoryCheck.py | pdmorale/Summarization | b2e68b3ec7990ee6a20c9881cb5d2012cced0d57 | [
"MIT"
] | null | null | null | text_summary/project_folder/Rawcode/directoryCheck.py | pdmorale/Summarization | b2e68b3ec7990ee6a20c9881cb5d2012cced0d57 | [
"MIT"
] | null | null | null | import os
def dirCheck():
dirpath = os.getcwd()
if dirpath == None:
return "here"
else:
return dirpath | 17.25 | 26 | 0.536232 |
4eb10f129b85b5e0e9886a44628eaea55abf6f5a | 460 | py | Python | 02. Math/zero in nCm.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | 1 | 2021-01-22T15:58:32.000Z | 2021-01-22T15:58:32.000Z | 02. Math/zero in nCm.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | null | null | null | 02. Math/zero in nCm.py | KLumy/Basic-Algorithm | e52e4200c1955a9062569814ff3418dd06666845 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
def countFacPrime(n, t):
step = t
result = 0
while n >= step:
result += n // step
step *= t
return result
n, m = map(int, input().split())
facN2 = countFacPrime(n, 2)
facN5 = countFacPrime(n, 5)
facM2 = countFacPrime(m, 2)
facM5 = countFacPrim... | 15.862069 | 52 | 0.634783 |
e17eef07fcc8ae115aa42083b775343497bf8e92 | 5,545 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/decorators_1_20210714131747.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/decorators_1_20210714131747.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/decorators_1_20210714131747.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """Decorators
Recall the simple closure example we did which allowed us to maintain a count of ho9w many times a function was called:
def counter(fn):
count = 0
def inner(*args, **kwargs): # using *args. **kwargs means we can call any function fn with any combination of positional and keyword arguments
... | 36.480263 | 205 | 0.520649 |
29c1deb81b579b97993fb208b42833f5e9cfe253 | 1,305 | py | Python | hardware/temperature_sensor/Max31865Sensor.py | magnusnordlander/silvia-pi | 3b927f73f8c8608a17f1f0e6458d06eff0f1d09a | [
"MIT"
] | 16 | 2020-06-09T22:34:18.000Z | 2021-02-09T15:31:16.000Z | hardware/temperature_sensor/Max31865Sensor.py | magnusnordlander/silvia-pi | 3b927f73f8c8608a17f1f0e6458d06eff0f1d09a | [
"MIT"
] | null | null | null | hardware/temperature_sensor/Max31865Sensor.py | magnusnordlander/silvia-pi | 3b927f73f8c8608a17f1f0e6458d06eff0f1d09a | [
"MIT"
] | 1 | 2020-09-03T15:21:15.000Z | 2020-09-03T15:21:15.000Z | import board
import busio
import digitalio
import random
from adafruit_max31865_fork import MAX31865
class Max31865Sensor(object):
def __init__(self, cs_boiler, cs_group, clock=board.SCK, mosi=board.MOSI, miso=board.MISO, wires=2, rtd_nominal_boiler=100, rtd_nominal_group=100):
# Initialize SPI bus and s... | 40.78125 | 151 | 0.71341 |
d95d627a4f07a41491ee8008e515c5d0242cf3ff | 2,768 | py | Python | space_images.py | redbor24/hubble_telegram | c557ae2b63e86e8fa09ffd3cee41bd5f5ca07567 | [
"MIT"
] | null | null | null | space_images.py | redbor24/hubble_telegram | c557ae2b63e86e8fa09ffd3cee41bd5f5ca07567 | [
"MIT"
] | null | null | null | space_images.py | redbor24/hubble_telegram | c557ae2b63e86e8fa09ffd3cee41bd5f5ca07567 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
from pathlib import Path
from urllib import parse
import requests
from config import IMAGES_PATH, NASA_TOKEN
def download_image(url, full_filename, params=None):
headers = {
'User-Agent': 'curl',
'Accept-Language': 'ru-RU'
}
response = requests.ge... | 27.137255 | 70 | 0.619942 |
bbfdfc3b7df963c35e9773891b0fd18f8f5d6c77 | 4,149 | py | Python | purity_fb/purity_fb_1dot10/models/support_response.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot10/models/support_response.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot10/models/support_response.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.10 Python SDK
Pure Storage FlashBlade REST 1.10 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.10
Contact... | 26.941558 | 205 | 0.574114 |
22b6ec1c3023e25b0fda9019d9d2a60ade18c90d | 240 | py | Python | redis_lru/__init__.py | funkyfuture/redis-lru | db8bbced7424c91a1918a46f66f20e6e9bdcd723 | [
"BSD-2-Clause"
] | null | null | null | redis_lru/__init__.py | funkyfuture/redis-lru | db8bbced7424c91a1918a46f66f20e6e9bdcd723 | [
"BSD-2-Clause"
] | null | null | null | redis_lru/__init__.py | funkyfuture/redis-lru | db8bbced7424c91a1918a46f66f20e6e9bdcd723 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: leohowell
@date: 2018/2/11
"""
from redis_lru.lru import redis_lru_cache, RedisLRUCacheDict
from redis_lru.utils import init_logger
__all__ = ['redis_lru_cache', 'RedisLRUCacheDict']
init_logger()
| 15 | 60 | 0.729167 |
9918200344cc323e949f776d0fe7744787205b40 | 4,918 | py | Python | telethon/events/messageread.py | pgjones/Telethon | 1be54035e81ee2e7f869fc2a8c20a16760924895 | [
"MIT"
] | null | null | null | telethon/events/messageread.py | pgjones/Telethon | 1be54035e81ee2e7f869fc2a8c20a16760924895 | [
"MIT"
] | null | null | null | telethon/events/messageread.py | pgjones/Telethon | 1be54035e81ee2e7f869fc2a8c20a16760924895 | [
"MIT"
] | null | null | null | from .common import EventBuilder, EventCommon, name_inner_event
from .. import utils
from ..tl import types
@name_inner_event
class MessageRead(EventBuilder):
"""
Occurs whenever one or more messages are read in a chat.
Args:
inbox (`bool`, optional):
If this argument is `True`, then ... | 38.124031 | 80 | 0.56527 |
8fdf02f4f75706551ffcb3bad383d8efe877b65c | 1,170 | py | Python | tests/plugins/test_float_image.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | 1 | 2022-03-11T00:37:00.000Z | 2022-03-11T00:37:00.000Z | tests/plugins/test_float_image.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | null | null | null | tests/plugins/test_float_image.py | iwpnd/folium | 67aab11039cd990d73fdf14566380286835ff84b | [
"MIT"
] | null | null | null | """
Test FloatImage
---------------
"""
import folium
from folium import plugins
from folium.utilities import normalize
from jinja2 import Template
def test_float_image():
m = folium.Map([45., 3.], zoom_start=4)
url = 'https://raw.githubusercontent.com/SECOORA/static_assets/master/maps/img/rose.png'
szt... | 26 | 94 | 0.593162 |
adfc7b5994cda4f19f44b7fe329e2215b97065c8 | 1,374 | py | Python | tests/importer/test_importer.py | mtag-dev/esg | f01e8caef23abb54ebc0db5279cbee3006dffa05 | [
"BSD-3-Clause"
] | 3 | 2022-01-11T19:04:37.000Z | 2022-01-12T16:03:10.000Z | tests/importer/test_importer.py | mtag-dev/esg | f01e8caef23abb54ebc0db5279cbee3006dffa05 | [
"BSD-3-Clause"
] | 4 | 2022-01-07T11:46:36.000Z | 2022-01-31T00:23:41.000Z | tests/importer/test_importer.py | mtag-dev/esg | f01e8caef23abb54ebc0db5279cbee3006dffa05 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T19:07:17.000Z | 2022-01-11T19:07:17.000Z | import pytest
from esg.importer import ImportFromStringError, import_from_string
def test_invalid_format() -> None:
with pytest.raises(ImportFromStringError) as exc_info:
import_from_string("example:")
expected = 'Import string "example:" must be in format "<module>:<attribute>".'
assert expected... | 31.227273 | 83 | 0.752547 |
18538fceec64c16b70252911532bee2d6b2de956 | 1,127 | py | Python | samples/gh-14.test_call_MMS.py | tropo/tropo-webapi-python | f87772644a6b45066a4c5218f0c1f6467b64ab3c | [
"MIT"
] | 21 | 2015-05-08T13:18:14.000Z | 2019-07-15T06:24:17.000Z | samples/gh-14.test_call_MMS.py | tropo/tropo-webapi-python | f87772644a6b45066a4c5218f0c1f6467b64ab3c | [
"MIT"
] | 8 | 2016-01-18T14:08:16.000Z | 2017-09-01T14:40:05.000Z | samples/gh-14.test_call_MMS.py | tropo/tropo-webapi-python | f87772644a6b45066a4c5218f0c1f6467b64ab3c | [
"MIT"
] | 23 | 2015-05-15T09:55:10.000Z | 2021-11-23T19:36:07.000Z | # tests fix of gh-14 for "from" parameter in the "call" function.
# Proposed convention is to use "_from" as the parameter
# so as not to conflict with "from" Python reserved word.
# _from arg works
# Invoke using a token
# Sample application using the itty-bitty python web framework from:
# http://github.com/toas... | 31.305556 | 257 | 0.703638 |
4f5e367c6ed5a3c3449eb4de459b07a273d3a970 | 11,715 | py | Python | src/examplePlugins/update_version_cut_values.py | tk421storm/shotgunEvents | 5c602edce929480453e53009f98ceff68e9c0b28 | [
"MIT"
] | 4 | 2019-04-03T14:57:03.000Z | 2019-07-05T09:01:28.000Z | src/examplePlugins/update_version_cut_values.py | tk421storm/shotgunEvents | 5c602edce929480453e53009f98ceff68e9c0b28 | [
"MIT"
] | 2 | 2022-03-21T21:06:10.000Z | 2022-03-22T11:10:02.000Z | src/examplePlugins/update_version_cut_values.py | tk421storm/shotgunEvents | 5c602edce929480453e53009f98ceff68e9c0b28 | [
"MIT"
] | 1 | 2020-04-23T19:04:53.000Z | 2020-04-23T19:04:53.000Z | # Copyright 2018 Autodesk, Inc. All rights reserved.
#
# Use of this software is subject to the terms of the Autodesk license agreement
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
#
# See docs folder for detailed usage info... | 33.28125 | 119 | 0.573453 |
b3b9f8b22c2face8da3569bf9d93a9b36a8045f2 | 487 | py | Python | test/interop/python/use_stringAllocated.py | wrongkindofdoctor/chapel | 5ff6d06cce86203007888e1710a9a51f3d58598c | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2015-03-02T01:42:08.000Z | 2021-05-11T22:04:04.000Z | test/interop/python/use_stringAllocated.py | karan0299/chapel | 69d7c380b96943763ae0340189013b7b98b595a4 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-09-19T17:35:56.000Z | 2019-09-19T20:54:12.000Z | test/interop/python/use_stringAllocated.py | karan0299/chapel | 69d7c380b96943763ae0340189013b7b98b595a4 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2015-03-01T13:02:20.000Z | 2021-02-27T01:55:40.000Z | import stringAllocated
import numpy
stringAllocated.chpl_setup()
x = numpy.empty(6, dtype=numpy.uint8)
newsize = stringAllocated.g(x.size, x)
if (newsize is not -1):
x = numpy.delete(x, range(newsize, x.size))
else:
stringAllocated.writeStr("Buffer wasn't wide enough")
resString = "" # note: str type, not byte... | 30.4375 | 76 | 0.741273 |
ef2fdbcaae199784efbac02c3d248289fb75f59b | 3,363 | py | Python | neutron/plugins/cisco/service_plugins/cisco_router_plugin.py | venkataanil/juno_neutron | 2e62e150c264ccae2dd75fb78caae453eaa77e9f | [
"Apache-2.0"
] | 1 | 2021-02-19T05:54:04.000Z | 2021-02-19T05:54:04.000Z | neutron/plugins/cisco/service_plugins/cisco_router_plugin.py | venkataanil/juno_neutron | 2e62e150c264ccae2dd75fb78caae453eaa77e9f | [
"Apache-2.0"
] | null | null | null | neutron/plugins/cisco/service_plugins/cisco_router_plugin.py | venkataanil/juno_neutron | 2e62e150c264ccae2dd75fb78caae453eaa77e9f | [
"Apache-2.0"
] | 2 | 2016-11-29T11:22:58.000Z | 2016-11-29T11:54:41.000Z | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 38.215909 | 79 | 0.68986 |
b91bd235f9f2054bf355d5a7311b0545d3545754 | 223 | py | Python | giico/giico/doctype/dynamic_cone_penetration_test/test_dynamic_cone_penetration_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | giico/giico/doctype/dynamic_cone_penetration_test/test_dynamic_cone_penetration_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | giico/giico/doctype/dynamic_cone_penetration_test/test_dynamic_cone_penetration_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, VHRS and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestDynamicConePenetrationTest(unittest.TestCase):
pass
| 20.272727 | 56 | 0.775785 |
b3f0b0071972e2a935252541cf6c2e1006713427 | 14,307 | py | Python | isort/settings.py | JulienGrv/isort | fcd80d46e66179f9464c2df745ffed07622d9ee3 | [
"MIT"
] | 1 | 2020-04-16T15:28:44.000Z | 2020-04-16T15:28:44.000Z | isort/settings.py | JulienGrv/isort | fcd80d46e66179f9464c2df745ffed07622d9ee3 | [
"MIT"
] | null | null | null | isort/settings.py | JulienGrv/isort | fcd80d46e66179f9464c2df745ffed07622d9ee3 | [
"MIT"
] | null | null | null | """isort/settings.py.
Defines how the default settings for isort should be loaded
(First from the default setting dictionary at the top of the file, then overridden by any settings
in ~/.isort.cfg if there are any)
Copyright (C) 2013 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any pers... | 52.406593 | 120 | 0.567205 |
6656ed8aacb567e7f7867ed5ce442c549d26948e | 278 | py | Python | module3.py | WuSiangRu/def_practice | cd7736051bbde2ad2f0c3695715870ea3bbbb706 | [
"MIT"
] | null | null | null | module3.py | WuSiangRu/def_practice | cd7736051bbde2ad2f0c3695715870ea3bbbb706 | [
"MIT"
] | null | null | null | module3.py | WuSiangRu/def_practice | cd7736051bbde2ad2f0c3695715870ea3bbbb706 | [
"MIT"
] | null | null | null | def foo ():
#pass
print("sssasaasas")
def bar ():
#pass
print("somthing")
# __name__是Python中一個隱含的變量它代表了模塊的名字
#只有被Python解釋器直接執行的模塊的名字才是__main__
if __name__ == '__main__':
print ( ' call foo() ' )
foo()
print ( ' call bar() ' )
bar() | 16.352941 | 34 | 0.57554 |
9da43c2e349c0d0c9a42b59d9f1959b49d671695 | 290 | py | Python | test/unit/conftest.py | tuneuptechnology/tuneuptechnology-python | 479bbece1722f7e233dbc0f7642205e1afa971c1 | [
"MIT"
] | null | null | null | test/unit/conftest.py | tuneuptechnology/tuneuptechnology-python | 479bbece1722f7e233dbc0f7642205e1afa971c1 | [
"MIT"
] | 2 | 2021-02-05T06:24:52.000Z | 2021-06-22T02:12:10.000Z | test/unit/conftest.py | tuneuptechnology/tuneuptechnology-python | 479bbece1722f7e233dbc0f7642205e1afa971c1 | [
"MIT"
] | 1 | 2021-06-22T02:32:23.000Z | 2021-06-22T02:32:23.000Z | import os
import pytest
@pytest.fixture
def api_email():
return os.getenv('API_EMAIL') or 'mock-email'
@pytest.fixture
def api_key():
return os.getenv('API_KEY') or 'mock-key'
@pytest.fixture
def base_url():
return os.getenv('BASE_URL') or 'http://tuneapp.localhost/api'
| 15.263158 | 66 | 0.7 |
62eca074f0fc68d0ffff276cf0f54e39c8a21815 | 6,862 | py | Python | gym_kuka_mujoco/controllers/pd_controller.py | leonmkim/gym-kuka-mujoco | ed45ae74d10e69f4e51439de2d1d0c0811623b6b | [
"MIT"
] | 23 | 2019-03-12T21:19:12.000Z | 2022-03-08T15:03:40.000Z | gym_kuka_mujoco/controllers/pd_controller.py | leonmkim/gym-kuka-mujoco | ed45ae74d10e69f4e51439de2d1d0c0811623b6b | [
"MIT"
] | 16 | 2019-04-21T17:50:13.000Z | 2022-03-11T23:40:29.000Z | gym_kuka_mujoco/controllers/pd_controller.py | leonmkim/gym-kuka-mujoco | ed45ae74d10e69f4e51439de2d1d0c0811623b6b | [
"MIT"
] | 14 | 2019-05-21T08:56:43.000Z | 2021-12-31T04:23:29.000Z | import os
import numpy as np
import gym
import mujoco_py
from gym_kuka_mujoco.envs.assets import kuka_asset_dir
from gym_kuka_mujoco.utils.mujoco_utils import kuka_subtree_mass, get_qpos_indices, get_qvel_indices, get_actuator_indices, get_joint_indices
from .base_controller import BaseController
from . import regist... | 42.621118 | 169 | 0.651414 |
ccbf2c278b0cf7e282133544b7e76f6723d4acbb | 146 | py | Python | checker/admin.py | uktrade/cf-app-version-checker | 58d32bcc627def37884159acf696d39a390b6abc | [
"MIT"
] | null | null | null | checker/admin.py | uktrade/cf-app-version-checker | 58d32bcc627def37884159acf696d39a390b6abc | [
"MIT"
] | null | null | null | checker/admin.py | uktrade/cf-app-version-checker | 58d32bcc627def37884159acf696d39a390b6abc | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import PipelineApp, PipelineEnv
admin.site.register(PipelineApp)
admin.site.register(PipelineEnv)
| 20.857143 | 44 | 0.835616 |
2b8cfd9827e5992cb3253c50f75dcc327cbd5cf2 | 36 | py | Python | config.py | lucidfrontier45/flasktest | 7700f35c732f9a9877d7bd34179d0a604b77a892 | [
"MIT"
] | null | null | null | config.py | lucidfrontier45/flasktest | 7700f35c732f9a9877d7bd34179d0a604b77a892 | [
"MIT"
] | null | null | null | config.py | lucidfrontier45/flasktest | 7700f35c732f9a9877d7bd34179d0a604b77a892 | [
"MIT"
] | null | null | null | __author__ = 'du'
DU_PARAM = "fuga" | 12 | 17 | 0.666667 |
99bc65bdb2792afd6fd1323365090957d34e851c | 528 | py | Python | opencv_py/image_transform/image_rotate.py | yinleiCoder/interesting-python | 8448b0731870feed033d845c085576a7d4a3154b | [
"Apache-2.0"
] | null | null | null | opencv_py/image_transform/image_rotate.py | yinleiCoder/interesting-python | 8448b0731870feed033d845c085576a7d4a3154b | [
"Apache-2.0"
] | null | null | null | opencv_py/image_transform/image_rotate.py | yinleiCoder/interesting-python | 8448b0731870feed033d845c085576a7d4a3154b | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
"""
OpenCV图像基本变换: 图像旋转[但是该api不能指定角度,要靠仿射变换]
rotate(img, rotateCode)
rotateCode: ROTATE_90_CLOCKWISE
rotateCode: ROTATE_180
rotateCode: ROTATE_90_COUNTERCLOCKWISE
"""
brother = cv2.imread(r'E:\PycharmProjects\funnyPython\opencv_py\data\imgs\yinzihao.png')
new = cv2.rotate(b... | 29.333333 | 88 | 0.774621 |
3f45d17b3a75a6860186005188249d5dda581a13 | 1,643 | py | Python | Matplotlib/code.py | kaushik0033/ga-learner-dsmp-repo | def2e7ac05274de8e3f2173b3ce35c6c55362c91 | [
"MIT"
] | null | null | null | Matplotlib/code.py | kaushik0033/ga-learner-dsmp-repo | def2e7ac05274de8e3f2173b3ce35c6c55362c91 | [
"MIT"
] | null | null | null | Matplotlib/code.py | kaushik0033/ga-learner-dsmp-repo | def2e7ac05274de8e3f2173b3ce35c6c55362c91 | [
"MIT"
] | null | null | null | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data=pd.read_csv(path)
loan_status=data['Loan_Status'].value_counts()
loan_status.plot(kind='bar')
#Code starts here
# --------------
#Code starts here
property_and_loan=data.groupby(['Property_Ar... | 24.161765 | 70 | 0.713938 |
5b7084a5bf5b957e837020f52fa4876c3cce4932 | 431 | py | Python | knobel-scripts/div7.py | testgk18/listcomprehension | 4745a3d24721b8a51f83b0f209d4b3d7218547ee | [
"MIT"
] | null | null | null | knobel-scripts/div7.py | testgk18/listcomprehension | 4745a3d24721b8a51f83b0f209d4b3d7218547ee | [
"MIT"
] | null | null | null | knobel-scripts/div7.py | testgk18/listcomprehension | 4745a3d24721b8a51f83b0f209d4b3d7218547ee | [
"MIT"
] | null | null | null | [(a,a*7)for a in range(10234,14109)if[str(a*100007).count(c)for c in"012345678"]==[1]*9]
[(a,a*7)for a in range(10234,14109)if all([str(a*100007).count(c)for c in"0123456789"])]
[(a,a*7)for a in range(10234,14109)if not set("0123456789").difference(str(a*100007))]
[(a,a*7)for a in range(10234,14109)if all(i in str(a*10... | 71.833333 | 88 | 0.686775 |
09f15f126d5b623ef16b9122981feb6e2b274848 | 2,190 | py | Python | pca/utils/dependency_injection/descriptors.py | pcah/python-clean-architecture | 20630d0b3b4c00f6503a26cc98c45df12bc31b3b | [
"MIT"
] | 278 | 2019-01-10T07:57:29.000Z | 2022-03-31T22:47:13.000Z | pca/utils/dependency_injection/descriptors.py | asuzukosi/python-clean-architecture | 20630d0b3b4c00f6503a26cc98c45df12bc31b3b | [
"MIT"
] | 80 | 2018-11-17T23:44:39.000Z | 2021-12-15T18:29:04.000Z | pca/utils/dependency_injection/descriptors.py | lhaze/dharma | 20630d0b3b4c00f6503a26cc98c45df12bc31b3b | [
"MIT"
] | 29 | 2018-11-19T20:11:13.000Z | 2022-03-02T06:27:34.000Z | import typing as t
from dataclasses import (
InitVar,
dataclass,
field,
)
from .container import (
DIContext,
get_di_container,
)
from .errors import (
ConfigError,
DIErrors,
)
@dataclass(frozen=True)
class Inject:
"""
A class that can serve as:
* a descriptor for a `Comp... | 28.441558 | 99 | 0.607763 |
8043b01f796a7fb230158bf970088894839f93ce | 1,459 | py | Python | PreprocessData/all_class_files/FoodEvent.py | wkid-neu/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | 3 | 2021-11-06T12:29:05.000Z | 2022-03-22T12:48:55.000Z | PreprocessData/all_class_files/FoodEvent.py | DylanNEU/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | null | null | null | PreprocessData/all_class_files/FoodEvent.py | DylanNEU/Schema | 4854720a15894dd814691a55e03329ecbbb6f558 | [
"MIT"
] | 1 | 2021-11-06T12:29:12.000Z | 2021-11-06T12:29:12.000Z | from PreprocessData.all_class_files.Event import Event
import global_data
class FoodEvent(Event):
def __init__(self, additionalType=None, alternateName=None, description=None, disambiguatingDescription=None, identifier=None, image=None, mainEntityOfPage=None, name=None, potentialAction=None, sameAs=None, url... | 182.375 | 781 | 0.823167 |
e321455fce07f1d50457971b916713efba228f6e | 1,773 | py | Python | src/gtk/toga_gtk/widgets/textinput.py | freshwuzhere/toga | ee3f6e9cec53ff967d7099b4f20fcad0c726332a | [
"BSD-3-Clause"
] | null | null | null | src/gtk/toga_gtk/widgets/textinput.py | freshwuzhere/toga | ee3f6e9cec53ff967d7099b4f20fcad0c726332a | [
"BSD-3-Clause"
] | null | null | null | src/gtk/toga_gtk/widgets/textinput.py | freshwuzhere/toga | ee3f6e9cec53ff967d7099b4f20fcad0c726332a | [
"BSD-3-Clause"
] | null | null | null | from travertino.size import at_least
from ..libs import Gtk
from .base import Widget
class TextInput(Widget):
def create(self):
self.native = Gtk.Entry()
self.native.interface = self.interface
self.native.connect('show', lambda event: self.rehint())
self.native.connect('changed', ... | 31.660714 | 89 | 0.673999 |
f8ce69454b871cf345a216445a5addb6ae47aa55 | 17,857 | py | Python | md_scripts/ba_run_expanded.py | JIMonroe/Surface_Affinities_Optimization | 94853571c690b099362431aac32d26611134a009 | [
"MIT"
] | null | null | null | md_scripts/ba_run_expanded.py | JIMonroe/Surface_Affinities_Optimization | 94853571c690b099362431aac32d26611134a009 | [
"MIT"
] | null | null | null | md_scripts/ba_run_expanded.py | JIMonroe/Surface_Affinities_Optimization | 94853571c690b099362431aac32d26611134a009 | [
"MIT"
] | 1 | 2021-03-07T11:52:27.000Z | 2021-03-07T11:52:27.000Z | #!/usr/bin/env python
from __future__ import division, print_function
import sys, os
import copy
import numpy as np
import simtk.openmm as mm
import simtk.openmm.app as app
import simtk.unit as u
import parmed as pmd
from parmed.openmm.reporters import NetCDFReporter
from pymbar import mbar
from openmm_surface_affini... | 51.166189 | 189 | 0.727838 |
c22add89c370808f9340a983ea60d7cec10500d2 | 6,499 | py | Python | templates/speaker_id/mini_librispeech_prepare.py | mdhaffar/speechbrain-1 | f3675c4bf8078573c9cbc7887aba6a87d72bf172 | [
"Apache-2.0"
] | 1 | 2021-03-15T10:31:21.000Z | 2021-03-15T10:31:21.000Z | templates/speaker_id/mini_librispeech_prepare.py | mirishkarganesh/speechbrain | 34bcf9d0783cf72a952674032834383194018b7b | [
"Apache-2.0"
] | null | null | null | templates/speaker_id/mini_librispeech_prepare.py | mirishkarganesh/speechbrain | 34bcf9d0783cf72a952674032834383194018b7b | [
"Apache-2.0"
] | 1 | 2021-07-04T09:07:47.000Z | 2021-07-04T09:07:47.000Z | """
Downloads and creates data manifest files for Mini LibriSpeech (spk-id).
For speaker-id, different senteces of the same speaker must appear in train,
validation, and test sets. In this case, these sets are thus derived from
splitting the orginal training set intothree chunks.
Authors:
* Mirco Ravanelli, 20... | 32.495 | 87 | 0.653793 |
af5e39fca29f8bc4cd7ad3ed807ee6d1b6ebc225 | 395 | py | Python | src/marketplace/templatetags/text.py | dssg/marketplace | c1ad9d25499c5dbafef3b06ba3eb1924ff1a5fbb | [
"MIT"
] | 5 | 2018-08-28T19:31:51.000Z | 2021-04-15T22:14:34.000Z | src/marketplace/templatetags/text.py | dssg/marketplace | c1ad9d25499c5dbafef3b06ba3eb1924ff1a5fbb | [
"MIT"
] | 49 | 2018-07-26T01:03:23.000Z | 2022-02-10T10:46:27.000Z | src/marketplace/templatetags/text.py | dssg/marketplace | c1ad9d25499c5dbafef3b06ba3eb1924ff1a5fbb | [
"MIT"
] | 2 | 2020-08-04T11:01:59.000Z | 2020-08-13T19:04:16.000Z | from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter
@stringfilter
def wordbreak(value, at):
"""Insert `<wbr>` after each occurence of `at`.
Facilitates legible breaking of `value` ac... | 21.944444 | 57 | 0.739241 |
76e641490c85c108cd5d1adb3e7ea9abe7752b07 | 230 | py | Python | TRT/SLO/__init__.py | AlohaWorld/TR | d006c3de55d06a7ad1225423bdc1e15fb3b9553f | [
"Apache-2.0"
] | null | null | null | TRT/SLO/__init__.py | AlohaWorld/TR | d006c3de55d06a7ad1225423bdc1e15fb3b9553f | [
"Apache-2.0"
] | null | null | null | TRT/SLO/__init__.py | AlohaWorld/TR | d006c3de55d06a7ad1225423bdc1e15fb3b9553f | [
"Apache-2.0"
] | null | null | null | #!/env/python
# -*- encoding: utf-8 -*-
"""
@version: 0.1
@author: wenzhiquan
@contact: wenzhiquanr@163.com
@site: http://github.wenzhiquan.io
@software: PyCharm
@file: __init__.py.py
@time: 16/6/15 下午9:05
@description: null
"""
| 16.428571 | 34 | 0.678261 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.