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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c45be92d15874a5e90e8e60efad7107c63df898 | 43,600 | py | Python | arelle/ValidateVersReport.py | theredpea/Arelle | e53097f142a69b2fefc18298a72f1f1b219b973d | [
"Apache-2.0"
] | 1 | 2018-01-04T01:39:04.000Z | 2018-01-04T01:39:04.000Z | arelle/ValidateVersReport.py | GuoHuiChen/Arelle | 76b3c720e55348fd91b7be091040d2207f85400c | [
"Apache-2.0"
] | null | null | null | arelle/ValidateVersReport.py | GuoHuiChen/Arelle | 76b3c720e55348fd91b7be091040d2207f85400c | [
"Apache-2.0"
] | null | null | null | '''
Created on Nov 9, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from arelle import ModelVersObject, XbrlConst, ValidateXbrl, ModelDocument
from arelle.ModelValue import qname
conceptAttributeEventAttributes = {
"conceptAttributeDelete": ("fromCust... | 80.740741 | 176 | 0.547546 | from arelle import ModelVersObject, XbrlConst, ValidateXbrl, ModelDocument
from arelle.ModelValue import qname
conceptAttributeEventAttributes = {
"conceptAttributeDelete": ("fromCustomAttribute",),
"conceptAttributeAdd": ("toCustomAttribute",),
"conceptAttributeChange": ("fromCustomAttribute",... | true | true |
1c45bee0b72f7290f98a152d2fd4047f74e16502 | 8,482 | py | Python | inbm/dispatcher-agent/dispatcher/fota/fota.py | intel/intel-inb-manageability | cdb17765120857fd41cacb838d6ee6e34e1f5047 | [
"Apache-2.0"
] | 5 | 2021-12-13T21:19:31.000Z | 2022-01-18T18:29:43.000Z | inbm/dispatcher-agent/dispatcher/fota/fota.py | intel/intel-inb-manageability | cdb17765120857fd41cacb838d6ee6e34e1f5047 | [
"Apache-2.0"
] | 45 | 2021-12-30T17:21:09.000Z | 2022-03-29T22:47:32.000Z | inbm/dispatcher-agent/dispatcher/fota/fota.py | intel/intel-inb-manageability | cdb17765120857fd41cacb838d6ee6e34e1f5047 | [
"Apache-2.0"
] | 4 | 2022-01-26T17:42:54.000Z | 2022-03-30T04:48:04.000Z | """
FOTA update tool which is called from the dispatcher during installation
Copyright (C) 2017-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import logging
import os
import platform
from threading import Timer
from typing import Any, Optional, Mapping
from future.moves.urllib.parse impo... | 42.838384 | 113 | 0.630512 |
import logging
import os
import platform
from threading import Timer
from typing import Any, Optional, Mapping
from future.moves.urllib.parse import urlparse
from inbm_common_lib.exceptions import UrlSecurityException
from inbm_common_lib.utility import canonicalize_uri
from inbm_common_lib.constants import REMOTE_SO... | true | true |
1c45bf70eca6a992410fb3243e168ae272e4fd35 | 1,699 | py | Python | coding_interviews/elements_of_programming_interview/delete_duplicates_from_a_sorted_array.py | LeandroTk/Algorithms | 569ed68eba3eeff902f8078992099c28ce4d7cd6 | [
"MIT"
] | 205 | 2018-12-01T17:49:49.000Z | 2021-12-22T07:02:27.000Z | coding_interviews/elements_of_programming_interview/delete_duplicates_from_a_sorted_array.py | LeandroTk/Algorithms | 569ed68eba3eeff902f8078992099c28ce4d7cd6 | [
"MIT"
] | 2 | 2020-01-01T16:34:29.000Z | 2020-04-26T19:11:13.000Z | coding_interviews/elements_of_programming_interview/delete_duplicates_from_a_sorted_array.py | LeandroTk/Algorithms | 569ed68eba3eeff902f8078992099c28ce4d7cd6 | [
"MIT"
] | 50 | 2018-11-28T20:51:36.000Z | 2021-11-29T04:08:25.000Z | # input: [2,3,5,5,7,11,11,11,13]
# output: [2,3,5,7,11,13,0,0,0]
# input: [-2,-2,1]
# output: [-2,1,0]
# input: [0,0,1,1]
# output: [0,1,0,0]
'''
result = []
counter = {}
loop input
is not in the counter
counter[number] << True
result << number
n = len(input) - len(result)
loop n
resul... | 20.22619 | 58 | 0.566215 |
def delete_duplicates(numbers):
if not numbers:
return [[], 0]
result = []
counter_mapper = {}
counter = 0
for number in numbers:
if number not in counter_mapper:
counter_mapper[number] = True
result.append(number)
counter += 1
differenc... | true | true |
1c45bfbfe06e66c030a706f0763fdf1865d626d3 | 1,904 | py | Python | map/views.py | alzseven/djeju | 5aade103dd97999dd7b5f97c461aeccbfb0ea23e | [
"MIT"
] | null | null | null | map/views.py | alzseven/djeju | 5aade103dd97999dd7b5f97c461aeccbfb0ea23e | [
"MIT"
] | 2 | 2021-06-04T23:32:09.000Z | 2021-06-10T19:39:20.000Z | map/views.py | alzseven/djeju | 5aade103dd97999dd7b5f97c461aeccbfb0ea23e | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.template import Context
import json
import requests
from map.models import Hospitals
from django.contrib.gis.geos import fromstr
from django.contrib.gis.db.models.functions import Distance
# Create your views here.
def maskmap(request):
# djangoReq
cur_lat = re... | 27.594203 | 117 | 0.605567 | from django.shortcuts import render
from django.template import Context
import json
import requests
from map.models import Hospitals
from django.contrib.gis.geos import fromstr
from django.contrib.gis.db.models.functions import Distance
def maskmap(request):
cur_lat = request.GET.get('lat')
cur_lng = req... | true | true |
1c45c0b5f0f1b4ac58ff0d930371bca1e8a86c2c | 31,428 | py | Python | boto/gs/key.py | dreamhost/boto | 57eaacfc66acd7083641ef504857786a12e330ff | [
"MIT"
] | null | null | null | boto/gs/key.py | dreamhost/boto | 57eaacfc66acd7083641ef504857786a12e330ff | [
"MIT"
] | null | null | null | boto/gs/key.py | dreamhost/boto | 57eaacfc66acd7083641ef504857786a12e330ff | [
"MIT"
] | null | null | null | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | 45.220144 | 91 | 0.616329 |
import base64
import binascii
import os
import re
import StringIO
from boto.exception import BotoClientError
from boto.s3.key import Key as S3Key
from boto.s3.keyfile import KeyFile
class Key(S3Key):
generation = None
meta_generation = None
def endElement(self, name, value, connection):
if name =... | true | true |
1c45c0eac73d31615a106f4522042ae688360bab | 2,494 | py | Python | forum/models.py | boxed/forum | abb3699d310bf3a404f031a3cb0e4bdbf403da5a | [
"BSD-3-Clause"
] | 2 | 2019-06-28T16:30:44.000Z | 2020-12-28T01:46:52.000Z | forum/models.py | boxed/forum | abb3699d310bf3a404f031a3cb0e4bdbf403da5a | [
"BSD-3-Clause"
] | 14 | 2019-02-26T17:25:54.000Z | 2019-04-03T18:11:24.000Z | forum/models.py | boxed/forum | abb3699d310bf3a404f031a3cb0e4bdbf403da5a | [
"BSD-3-Clause"
] | 1 | 2019-06-14T14:21:47.000Z | 2019-06-14T14:21:47.000Z | from hashlib import md5
from django.contrib.auth.models import User
from django.core import validators
from django.db import models
from iommi import register_factory
from unread.models import UnreadModel
class Model(models.Model):
def __repr__(self):
return f'{type(self)} {self.pk}:{self}'
class M... | 29 | 111 | 0.690056 | from hashlib import md5
from django.contrib.auth.models import User
from django.core import validators
from django.db import models
from iommi import register_factory
from unread.models import UnreadModel
class Model(models.Model):
def __repr__(self):
return f'{type(self)} {self.pk}:{self}'
class M... | true | true |
1c45c15f9e69201656c5a6fd742639e0189553ed | 15,419 | py | Python | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_keys_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_keys_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_keys_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.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.640379 | 195 | 0.660938 | 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 ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline ... | true | true |
1c45c21bce32039850b2b214ced69db7934f7418 | 5,134 | py | Python | samples/demo.py | siyuan-song/Container | 42313132af32f2edf710643b9ceb8ca84693ba5c | [
"MIT"
] | 2 | 2020-07-17T02:24:00.000Z | 2020-07-17T21:14:45.000Z | samples/demo.py | siyuan-song/Container | 42313132af32f2edf710643b9ceb8ca84693ba5c | [
"MIT"
] | null | null | null | samples/demo.py | siyuan-song/Container | 42313132af32f2edf710643b9ceb8ca84693ba5c | [
"MIT"
] | null | null | null |
# coding: utf-8
# # Mask R-CNN Demo
#
# A quick intro to using the pre-trained model to detect and segment objects.
# In[1]:
import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
# Root directory of the project
ROOT_DIR = os.path.abs... | 34.456376 | 421 | 0.730619 |
import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
ROOT_DIR = os.path.abspath("../")
sys.path.append(ROOT_DIR) from mrcnn import utils
import mrcnn.model as modellib
from mrcnn import visualize
sys.path.append(os.path.join(ROOT_D... | true | true |
1c45c26bdf9dbb63739a39e2d750920b7e4c23b2 | 1,886 | py | Python | terrascript/heroku/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/heroku/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/heroku/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/heroku/r.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class heroku_account_feature(terrascript.Resource):
pass
class heroku_addon(terrascript.Resource):
... | 15.459016 | 79 | 0.782078 |
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class heroku_account_feature(terrascript.Resource):
pass
class heroku_addon(terrascript.Resource):
pass
class heroku_addon_attachment(terrascript.Resource):
pass
clas... | true | true |
1c45c374300575c38d0712283bbc628b33dfa7e8 | 20,243 | py | Python | save/tokyo202112_MemGCRN_c1to1_20220208115005_time/traintest_MemGCRN.py | deepkashiwa20/TrafficAccident | c5fb26106137a4e85e5b5aa1e8ffdbb672a61988 | [
"MIT"
] | null | null | null | save/tokyo202112_MemGCRN_c1to1_20220208115005_time/traintest_MemGCRN.py | deepkashiwa20/TrafficAccident | c5fb26106137a4e85e5b5aa1e8ffdbb672a61988 | [
"MIT"
] | null | null | null | save/tokyo202112_MemGCRN_c1to1_20220208115005_time/traintest_MemGCRN.py | deepkashiwa20/TrafficAccident | c5fb26106137a4e85e5b5aa1e8ffdbb672a61988 | [
"MIT"
] | null | null | null | import sys
import os
import shutil
import math
import numpy as np
import pandas as pd
import scipy.sparse as ss
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from datetime import datetime
import time
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from to... | 50.230769 | 202 | 0.644173 | import sys
import os
import shutil
import math
import numpy as np
import pandas as pd
import scipy.sparse as ss
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from datetime import datetime
import time
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from to... | true | true |
1c45c40bf2888f61ea031bfc6439f06b59f6dae5 | 664 | py | Python | manage.py | njiiri12/neighbourhood | e36f04f450c352f3947ff991118e4c06cc5bcb87 | [
"MIT"
] | null | null | null | manage.py | njiiri12/neighbourhood | e36f04f450c352f3947ff991118e4c06cc5bcb87 | [
"MIT"
] | null | null | null | manage.py | njiiri12/neighbourhood | e36f04f450c352f3947ff991118e4c06cc5bcb87 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NH_watch.settings')
try:
from django.core.management import execute_from_command_line
except Imp... | 28.869565 | 73 | 0.679217 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NH_watch.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 installed and "
... | true | true |
1c45c46dba085dae7fe79cedf838de675bd3c279 | 5,081 | py | Python | opps/articles/views.py | jeanmask/opps | 031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87 | [
"MIT"
] | 159 | 2015-01-03T16:36:35.000Z | 2022-03-29T20:50:13.000Z | opps/articles/views.py | jeanmask/opps | 031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87 | [
"MIT"
] | 81 | 2015-01-02T21:26:16.000Z | 2021-05-29T12:24:52.000Z | opps/articles/views.py | jeanmask/opps | 031c6136c38d43aa6d1ccb25a94f7bcd65ccbf87 | [
"MIT"
] | 75 | 2015-01-23T13:41:03.000Z | 2021-09-24T03:45:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.sites.models import get_current_site
from django.utils import timezone
from django.conf import settings
from opps.views.generic.list import ListView
from opps.containers.views import ContainerList
from opps.containers.models import Container, ContainerB... | 35.531469 | 77 | 0.597717 | from django.contrib.sites.models import get_current_site
from django.utils import timezone
from django.conf import settings
from opps.views.generic.list import ListView
from opps.containers.views import ContainerList
from opps.containers.models import Container, ContainerBox
from opps.articles.models import Album
cl... | true | true |
1c45c4b27799ee041b7c97394535e06eaba9dfb4 | 51,275 | py | Python | cogs/game/minigames/game_of_life/player.py | FellowHashbrown/omega-psi-py | 4ea33cdbef15ffaa537f2c9e382de508c58093fc | [
"MIT"
] | 4 | 2018-12-23T08:49:40.000Z | 2021-03-25T16:51:43.000Z | cogs/game/minigames/game_of_life/player.py | FellowHashbrown/omega-psi-py | 4ea33cdbef15ffaa537f2c9e382de508c58093fc | [
"MIT"
] | 23 | 2020-11-03T17:40:40.000Z | 2022-02-01T17:12:59.000Z | cogs/game/minigames/game_of_life/player.py | FellowHashbrown/omega-psi-py | 4ea33cdbef15ffaa537f2c9e382de508c58093fc | [
"MIT"
] | 1 | 2019-07-11T23:40:13.000Z | 2019-07-11T23:40:13.000Z | from asyncio import sleep
from discord import Embed
from math import ceil
from random import randint, choice
from cogs.globals import PRIMARY_EMBED_COLOR, NUMBER_EMOJIS, LEAVE
from cogs.game.minigames.base_game.player import Player
from cogs.game.minigames.game_of_life.functions import choose_house
from cogs.game.mi... | 38.122677 | 144 | 0.505958 | from asyncio import sleep
from discord import Embed
from math import ceil
from random import randint, choice
from cogs.globals import PRIMARY_EMBED_COLOR, NUMBER_EMOJIS, LEAVE
from cogs.game.minigames.base_game.player import Player
from cogs.game.minigames.game_of_life.functions import choose_house
from cogs.game.mi... | true | true |
1c45c55d868ffd36fb6e4d51f703e1ffad0a1d37 | 12,262 | py | Python | apps/usuario/view/views_perfil.py | Ajerhy/proyectosigetebr | 5b63f194bbe06adb92d1cdbba93d1e0028b4164f | [
"MIT"
] | 1 | 2020-05-11T13:29:41.000Z | 2020-05-11T13:29:41.000Z | apps/usuario/view/views_perfil.py | Ajerhy/proyectosigetebr | 5b63f194bbe06adb92d1cdbba93d1e0028b4164f | [
"MIT"
] | 11 | 2020-02-12T03:19:44.000Z | 2022-03-12T00:10:31.000Z | apps/usuario/view/views_perfil.py | Ajerhy/proyectosigetebr | 5b63f194bbe06adb92d1cdbba93d1e0028b4164f | [
"MIT"
] | null | null | null | from django.shortcuts import redirect, render
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.views.generic import (CreateView, UpdateView, DetailView, TemplateView, View, DeleteView,ListView)
from django.shortcuts import render, redire... | 38.438871 | 110 | 0.676562 | from django.shortcuts import redirect, render
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.views.generic import (CreateView, UpdateView, DetailView, TemplateView, View, DeleteView,ListView)
from django.shortcuts import render, redire... | true | true |
1c45c58302360fe1ea1256f259b08d194601aee0 | 9,269 | py | Python | spookbot.py | carsuki/discord-spookbot | a6bd5b7e80860d7db65f3eb634bab68b9d4c50f1 | [
"BSD-3-Clause"
] | 1 | 2021-10-01T13:44:05.000Z | 2021-10-01T13:44:05.000Z | spookbot.py | carsuki/discord-spookbot | a6bd5b7e80860d7db65f3eb634bab68b9d4c50f1 | [
"BSD-3-Clause"
] | null | null | null | spookbot.py | carsuki/discord-spookbot | a6bd5b7e80860d7db65f3eb634bab68b9d4c50f1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import asyncio
import discord
import logging
import json
import random
logger = logging.getLogger('spookbot')
logger.setLevel(logging.INFO)
handler = logging.FileHandler(filename='spookbot.log', mode='w', encoding='utf-8')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name... | 130.549296 | 7,276 | 0.784659 |
import asyncio
import discord
import logging
import json
import random
logger = logging.getLogger('spookbot')
logger.setLevel(logging.INFO)
handler = logging.FileHandler(filename='spookbot.log', mode='w', encoding='utf-8')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logg... | true | true |
1c45c59d5474af1e72f1993635d141aeccc75b6e | 416 | py | Python | products/migrations/0002_auto_20210110_1353.py | ashishkr619/dukaan_main | b236b498b95f62160959b5e84bb642a0be6063b0 | [
"MIT"
] | null | null | null | products/migrations/0002_auto_20210110_1353.py | ashishkr619/dukaan_main | b236b498b95f62160959b5e84bb642a0be6063b0 | [
"MIT"
] | null | null | null | products/migrations/0002_auto_20210110_1353.py | ashishkr619/dukaan_main | b236b498b95f62160959b5e84bb642a0be6063b0 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.17 on 2021-01-10 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='product',
name='category',
... | 21.894737 | 86 | 0.612981 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='product',
name='category',
field=models.CharField(max_length=120, verbos... | true | true |
1c45c5a180008bb7c796a6f16b8559ac7395f0c5 | 1,094 | py | Python | test/fx2trt/converters/acc_op/test_relu.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | 1 | 2022-01-31T14:15:35.000Z | 2022-01-31T14:15:35.000Z | test/fx2trt/converters/acc_op/test_relu.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | 1 | 2022-02-03T12:43:23.000Z | 2022-02-03T12:47:53.000Z | test/fx2trt/converters/acc_op/test_relu.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | null | null | null | # Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
import torch.nn as nn
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
from torch.testing._internal.common_utils import run_tests
class TestReLUConverter(AccTestCase):
def test_relu(sel... | 29.567568 | 78 | 0.606947 |
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
import torch.nn as nn
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
from torch.testing._internal.common_utils import run_tests
class TestReLUConverter(AccTestCase):
def test_relu(self):
class TestModule(n... | true | true |
1c45c79ba7fba114d9c50c58c0dee7cf69a990c6 | 36,332 | py | Python | scripts/validate_docstrings.py | kpflugshaupt/pandas | c9e3883c630c48b17218e6bcc5593720c1402bf1 | [
"BSD-3-Clause"
] | 80 | 2015-01-01T17:32:11.000Z | 2022-01-24T07:17:47.000Z | scripts/validate_docstrings.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | null | null | null | scripts/validate_docstrings.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | 28 | 2015-01-30T16:07:48.000Z | 2022-02-11T18:41:13.000Z | #!/usr/bin/env python
"""
Analyze docstrings to detect errors.
If no argument is provided, it does a quick check of docstrings and returns
a csv with all API functions and results of basic checks.
If a function or method is provided in the form "pandas.function",
"pandas.module.class.method", etc. a list of all error... | 36.588117 | 79 | 0.572168 | import os
import sys
import json
import re
import glob
import functools
import collections
import argparse
import pydoc
import inspect
import importlib
import doctest
import tempfile
import ast
import textwrap
import flake8.main.application
try:
from io import StringIO
except ImportError:
from cStringIO impor... | true | true |
1c45c79cdc783d17fc365a898f4c6a3109e9d344 | 2,508 | py | Python | api_app/models/schemas/workspace.py | tanya-borisova/AzureTRE | 02e1745785a75a7dc676d9b9853ae4d4de7d87af | [
"MIT"
] | null | null | null | api_app/models/schemas/workspace.py | tanya-borisova/AzureTRE | 02e1745785a75a7dc676d9b9853ae4d4de7d87af | [
"MIT"
] | 1 | 2022-02-02T14:52:06.000Z | 2022-02-02T15:00:01.000Z | api_app/models/schemas/workspace.py | tanya-borisova/AzureTRE | 02e1745785a75a7dc676d9b9853ae4d4de7d87af | [
"MIT"
] | null | null | null | from enum import Enum
from typing import List
from pydantic import BaseModel, Field
from models.domain.resource import ResourceType
from models.domain.workspace import Workspace
def get_sample_workspace(workspace_id: str, spec_workspace_id: str = "0001") -> dict:
return {
"id": workspace_id,
"is... | 27.56044 | 152 | 0.585726 | from enum import Enum
from typing import List
from pydantic import BaseModel, Field
from models.domain.resource import ResourceType
from models.domain.workspace import Workspace
def get_sample_workspace(workspace_id: str, spec_workspace_id: str = "0001") -> dict:
return {
"id": workspace_id,
"is... | true | true |
1c45c8088030d2b6425eb6a785a0705fba310bdf | 694 | py | Python | Menu/BaseScripts/updateBlock.py | fortiersteven/Narikiri-Dungeon-X | 49e5716fa5aa81a25048bcbe212eb74828cf0e10 | [
"MIT"
] | 10 | 2021-06-04T10:17:48.000Z | 2022-01-23T13:23:37.000Z | Menu/BaseScripts/updateBlock.py | fortiersteven/Narikiri-Dungeon-X | 49e5716fa5aa81a25048bcbe212eb74828cf0e10 | [
"MIT"
] | 1 | 2021-06-05T17:05:04.000Z | 2021-06-05T17:05:04.000Z | Menu/BaseScripts/updateBlock.py | fortiersteven/Narikiri-Dungeon-X | 49e5716fa5aa81a25048bcbe212eb74828cf0e10 | [
"MIT"
] | 4 | 2021-05-21T11:21:04.000Z | 2022-01-06T18:50:12.000Z | from HelperfunctionsNew import *
import sys
import os
if __name__ == "__main__":
blockDesc = sys.argv[1]
helper = Helper()
herlper.get
if blockDesc in ["Skit Name", "Synopsis", "Minigame"]:
helper.createBlock_Multi(blockDesc)
elif blockDesc != "All":
... | 23.133333 | 58 | 0.602305 | from HelperfunctionsNew import *
import sys
import os
if __name__ == "__main__":
blockDesc = sys.argv[1]
helper = Helper()
herlper.get
if blockDesc in ["Skit Name", "Synopsis", "Minigame"]:
helper.createBlock_Multi(blockDesc)
elif blockDesc != "All":
... | true | true |
1c45c86d301eb86719539dd517c54c2d7968b0d2 | 2,061 | py | Python | sdk/python/pulumi_aws/__init__.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/__init__.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/__init__.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import importlib
# Make subpackages available:
__all__ = ['acm', 'acmpca', 'apigateway', 'appautoscaling', 'applicationloadbalancing', ... | 73.607143 | 1,216 | 0.706938 |
import importlib
# Make subpackages available:
__all__ = ['acm', 'acmpca', 'apigateway', 'appautoscaling', 'applicationloadbalancing', 'appmesh', 'appsync', 'athena', 'autoscaling', 'backup', 'batch', 'budgets', 'cfg', 'cloud9', 'cloudformation', 'cloudfront', 'cloudhsmv2', 'cloudtrail', 'cloudwatch', 'codebuild', 'co... | true | true |
1c45c9928167414ac58f3e156afea4d5426540e6 | 122 | py | Python | ecommerce/api/category/admin.py | jigyasudhingra/E-commerce-Store-Using-React-And-Django | 128e0e3d78dd7aca309c851eff2d02e2452d4d1f | [
"MIT"
] | 1 | 2021-12-04T08:47:29.000Z | 2021-12-04T08:47:29.000Z | ecommerce/api/category/admin.py | jigyasudhingra/E-commerce-Store-Using-React-And-Django | 128e0e3d78dd7aca309c851eff2d02e2452d4d1f | [
"MIT"
] | null | null | null | ecommerce/api/category/admin.py | jigyasudhingra/E-commerce-Store-Using-React-And-Django | 128e0e3d78dd7aca309c851eff2d02e2452d4d1f | [
"MIT"
] | 1 | 2021-05-15T07:23:37.000Z | 2021-05-15T07:23:37.000Z | from django.contrib import admin
from .models import Category
# Register your models here.
admin.site.register(Category)
| 20.333333 | 32 | 0.811475 | from django.contrib import admin
from .models import Category
admin.site.register(Category)
| true | true |
1c45ca09ffeae3aabe2a3a4553e18bbea7714321 | 595 | py | Python | pyaz/eventgrid/topic_type/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/eventgrid/topic_type/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/eventgrid/topic_type/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | 1 | 2022-02-03T09:12:01.000Z | 2022-02-03T09:12:01.000Z | from ... pyaz_utils import _call_az
def list():
'''
List registered topic types.
'''
return _call_az("az eventgrid topic-type list", locals())
def show(name):
'''
Get the details for a topic type.
Required Parameters:
- name -- Name of the topic type.
'''
return _call_az("az ... | 20.517241 | 73 | 0.636975 | from ... pyaz_utils import _call_az
def list():
return _call_az("az eventgrid topic-type list", locals())
def show(name):
return _call_az("az eventgrid topic-type show", locals())
def list_event_types(name):
return _call_az("az eventgrid topic-type list-event-types", locals())
| true | true |
1c45ca0d1bfde8aae6ad6466c099bac46b3121a0 | 4,702 | py | Python | sdk/python/pulumi_aws/iot/thing_principal_attachment.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/iot/thing_principal_attachment.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/iot/thing_principal_attachment.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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
from .. import _utilitie... | 38.859504 | 134 | 0.630795 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__all__ = ['ThingPrincipalAttachment']
class ThingPrincipalAttachment(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
1c45cb82a5676f74fee689944bd273eb30fc85e0 | 4,151 | py | Python | Tests/Plot/LamWind/test_Slot_LSRPM_plot.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | Tests/Plot/LamWind/test_Slot_LSRPM_plot.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | Tests/Plot/LamWind/test_Slot_LSRPM_plot.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
from os.path import join
import pytest
import matplotlib.pyplot as plt
from numpy import array, pi, zeros
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.LamSquirrelCage import LamSquirrelCage
from pyleecan.Classes.MachineDFIM... | 29.863309 | 89 | 0.530956 | from os.path import join
import pytest
import matplotlib.pyplot as plt
from numpy import array, pi, zeros
from pyleecan.Classes.Frame import Frame
from pyleecan.Classes.LamSlotWind import LamSlotWind
from pyleecan.Classes.LamSquirrelCage import LamSquirrelCage
from pyleecan.Classes.MachineDFIM import MachineDFIM
from... | true | true |
1c45cc01daf7a254c2fe16fed376b3fc58df574f | 1,643 | py | Python | src/nucleotide/component/windows/msvc/atom/version.py | dmilos/nucleotide | aad5d60508c9e4baf4888069284f2cb5c9fd7c55 | [
"Apache-2.0"
] | 1 | 2020-09-04T13:00:04.000Z | 2020-09-04T13:00:04.000Z | src/nucleotide/component/windows/msvc/atom/version.py | dmilos/nucleotide | aad5d60508c9e4baf4888069284f2cb5c9fd7c55 | [
"Apache-2.0"
] | 1 | 2020-04-10T01:52:32.000Z | 2020-04-10T09:11:29.000Z | src/nucleotide/component/windows/msvc/atom/version.py | dmilos/nucleotide | aad5d60508c9e4baf4888069284f2cb5c9fd7c55 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# Copyright 2015 Dejan D. M. Milosavljevic
#
# 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
#
# ... | 27.847458 | 109 | 0.625685 |
import os
import subprocess
import nucleotide
import nucleotide.component
import nucleotide.component.function
def _windows_version_MSVC_VERSION( P_data ):
if( False == ( 'msvc' in P_data ) ):
return None
print( " ||" + str( P_data ) + "||" )
return P_data[ 'msvc' ][0]
a... | true | true |
1c45ccb173f55ce3b5f37cb85aa9fc13c1fdd831 | 791 | py | Python | david/modules/event/admin.py | ktmud/david | 4b8d6f804b73cdfa1a8ddf784077fa9a39f1e36f | [
"MIT"
] | 2 | 2016-04-07T08:21:32.000Z | 2020-11-26T11:49:20.000Z | david/modules/event/admin.py | ktmud/david | 4b8d6f804b73cdfa1a8ddf784077fa9a39f1e36f | [
"MIT"
] | null | null | null | david/modules/event/admin.py | ktmud/david | 4b8d6f804b73cdfa1a8ddf784077fa9a39f1e36f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from david.core.article.admin import ArticleAdmin, ModelAdmin
from david.ext.admin import _
from .model import Event
class EventAdmin(ArticleAdmin):
column_labels = dict(
title=_('Title'),
slug=_('Slug'),
id=_('ID'),
tags=_('Tags'),
... | 27.275862 | 61 | 0.542351 | from david.core.article.admin import ArticleAdmin, ModelAdmin
from david.ext.admin import _
from .model import Event
class EventAdmin(ArticleAdmin):
column_labels = dict(
title=_('Title'),
slug=_('Slug'),
id=_('ID'),
tags=_('Tags'),
create_at=_('Create a... | true | true |
1c45ccf0ef4a8a26e47030e104f785132e53c97d | 31,133 | py | Python | flexmock_test.py | sagara-/flexmock | 0b24b769cd04e234d4921089053707a5565aa007 | [
"BSD-2-Clause"
] | null | null | null | flexmock_test.py | sagara-/flexmock | 0b24b769cd04e234d4921089053707a5565aa007 | [
"BSD-2-Clause"
] | null | null | null | flexmock_test.py | sagara-/flexmock | 0b24b769cd04e234d4921089053707a5565aa007 | [
"BSD-2-Clause"
] | null | null | null | #-*- coding: utf8 -*-
from flexmock import FlexMock
from flexmock import AlreadyMocked
from flexmock import AndExecuteNotSupportedForClassMocks
from flexmock import AttemptingToMockBuiltin
from flexmock import Expectation
from flexmock import FlexmockContainer
from flexmock import FlexmockException
from flexmock import... | 36.201163 | 81 | 0.710886 | from flexmock import FlexMock
from flexmock import AlreadyMocked
from flexmock import AndExecuteNotSupportedForClassMocks
from flexmock import AttemptingToMockBuiltin
from flexmock import Expectation
from flexmock import FlexmockContainer
from flexmock import FlexmockException
from flexmock import InvalidMethodSignatur... | true | true |
1c45ccf6c4e027fc171552bcb089538da702ede9 | 3,773 | py | Python | dataviz/timeline_gibraltar.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | 119 | 2017-07-22T15:02:30.000Z | 2021-08-02T10:42:59.000Z | dataviz/timeline_gibraltar.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | null | null | null | dataviz/timeline_gibraltar.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | 28 | 2017-08-04T14:28:41.000Z | 2019-11-27T23:46:14.000Z | from pudzu.charts import *
from pudzu.dates import *
from collections import defaultdict
df = pd.read_csv("datasets/timeline_gibraltar.csv")
df_events = pd.read_csv("datasets/timeline_gibraltar_events.csv")
START, END, INTERVAL = 1000, 2000, 250
PHOTOS = ["http://www.kindredgroup.com/wp-content/uploads/2016/1... | 49.644737 | 181 | 0.662073 | from pudzu.charts import *
from pudzu.dates import *
from collections import defaultdict
df = pd.read_csv("datasets/timeline_gibraltar.csv")
df_events = pd.read_csv("datasets/timeline_gibraltar_events.csv")
START, END, INTERVAL = 1000, 2000, 250
PHOTOS = ["http://www.kindredgroup.com/wp-content/uploads/2016/1... | true | true |
1c45cf4bdee098de3ed2c46a413ab004e8e94cbf | 1,436 | py | Python | tests/test_tools_jobinfo.py | NERSC/pytokio | 22244718cf82567c50620cbe0e635dfc990de36b | [
"BSD-3-Clause-LBNL"
] | 22 | 2017-11-14T01:30:48.000Z | 2022-01-01T21:51:00.000Z | tests/test_tools_jobinfo.py | glennklockwood/pytokio | 22244718cf82567c50620cbe0e635dfc990de36b | [
"BSD-3-Clause-LBNL"
] | 39 | 2017-12-20T01:42:19.000Z | 2020-05-28T21:17:26.000Z | tests/test_tools_jobinfo.py | glennklockwood/pytokio | 22244718cf82567c50620cbe0e635dfc990de36b | [
"BSD-3-Clause-LBNL"
] | 5 | 2018-02-06T19:39:19.000Z | 2019-07-10T01:20:26.000Z | """Test jobinfo and all supported backends
"""
import tokio.tools.jobinfo
import tokiotest
def test_get_job_startend_slurm():
"""tools.jobinfo.get_job_startend, Slurm
"""
tokio.config.CONFIG["jobinfo_jobid_providers"] = ["slurm"]
start, end = tokio.tools.jobinfo.get_job_startend(
jobid=tokiotes... | 31.217391 | 69 | 0.722145 | import tokio.tools.jobinfo
import tokiotest
def test_get_job_startend_slurm():
tokio.config.CONFIG["jobinfo_jobid_providers"] = ["slurm"]
start, end = tokio.tools.jobinfo.get_job_startend(
jobid=tokiotest.SAMPLE_DARSHAN_JOBID,
cache_file=tokiotest.SAMPLE_SLURM_CACHE_FILE)
print(start, end)
... | true | true |
1c45cf7be7c3d2e904239c5a45cec80098ce6554 | 78 | py | Python | wmf/dump/__init__.py | maribelacosta/wikiwho | 5c53f129b018541aad0cc63be5e03a862e6183a1 | [
"MIT"
] | 17 | 2015-01-04T15:17:15.000Z | 2019-09-17T15:38:43.000Z | wmf/dump/__init__.py | maribelacosta/wikiwho | 5c53f129b018541aad0cc63be5e03a862e6183a1 | [
"MIT"
] | 5 | 2015-06-03T09:07:40.000Z | 2017-03-31T16:36:13.000Z | wmf/dump/__init__.py | maribelacosta/wikiwho | 5c53f129b018541aad0cc63be5e03a862e6183a1 | [
"MIT"
] | 10 | 2015-02-11T11:50:11.000Z | 2021-07-28T02:17:16.000Z | from .iterator import Iterator
from .map import map
from .map import dumpFile
| 19.5 | 30 | 0.807692 | from .iterator import Iterator
from .map import map
from .map import dumpFile
| true | true |
1c45cfcca17602a353dfd446b147a8f1cf0251e7 | 4,479 | py | Python | tests/samples.py | chikko80/bit | af557cde90c9021ee16024ab89a000961c6062b4 | [
"MIT"
] | 1,173 | 2016-11-30T19:45:44.000Z | 2022-03-31T15:43:58.000Z | tests/samples.py | chikko80/bit | af557cde90c9021ee16024ab89a000961c6062b4 | [
"MIT"
] | 155 | 2017-03-17T13:06:42.000Z | 2022-02-28T16:59:14.000Z | tests/samples.py | chikko80/bit | af557cde90c9021ee16024ab89a000961c6062b4 | [
"MIT"
] | 197 | 2017-02-16T04:30:29.000Z | 2022-03-24T09:38:29.000Z | import os
BINARY_ADDRESS = b'\x00\x92F\x1b\xdeb\x83\xb4a\xec\xe7\xdd\xf4\xdb\xf1\xe0\xa4\x8b\xd1\x13\xd8&E\xb4\xbf'
BITCOIN_ADDRESS = '1ELReFsTCUY2mfaDTy32qxYiT49z786eFg'
BITCOIN_ADDRESS_COMPRESSED = '1ExJJsNLQDNVVM1s1sdyt1o5P3GC5r32UG'
BITCOIN_ADDRESS_NP2WKH = '3291hXxutb58vbDVVumaJpopanmfxjVpgJ'
BITCOIN_ADDRESS_PAY2... | 67.863636 | 150 | 0.841036 | import os
BINARY_ADDRESS = b'\x00\x92F\x1b\xdeb\x83\xb4a\xec\xe7\xdd\xf4\xdb\xf1\xe0\xa4\x8b\xd1\x13\xd8&E\xb4\xbf'
BITCOIN_ADDRESS = '1ELReFsTCUY2mfaDTy32qxYiT49z786eFg'
BITCOIN_ADDRESS_COMPRESSED = '1ExJJsNLQDNVVM1s1sdyt1o5P3GC5r32UG'
BITCOIN_ADDRESS_NP2WKH = '3291hXxutb58vbDVVumaJpopanmfxjVpgJ'
BITCOIN_ADDRESS_PAY2... | true | true |
1c45cff204c2083e87e0c5b405062242ac5f4e29 | 2,254 | py | Python | .config/qutebrowser/config.py | SqrtMinusOne/dotfiles | 1121bd865cb9ed019e9e4c257155e2fb483d98c5 | [
"Apache-2.0"
] | 12 | 2021-05-01T11:08:55.000Z | 2022-03-27T05:57:02.000Z | .config/qutebrowser/config.py | SqrtMinusOne/dotfiles | 1121bd865cb9ed019e9e4c257155e2fb483d98c5 | [
"Apache-2.0"
] | 1 | 2022-02-13T14:54:29.000Z | 2022-02-13T15:42:55.000Z | .config/qutebrowser/config.py | SqrtMinusOne/dotfiles | 1121bd865cb9ed019e9e4c257155e2fb483d98c5 | [
"Apache-2.0"
] | 4 | 2021-05-22T21:31:28.000Z | 2022-03-30T21:28:33.000Z | import os
import dracula.draw
from qutebrowser.api import interceptor
def filter_yt(info: interceptor.Request):
"""Block the given request if necessary."""
url = info.request_url
if (url.host() == 'www.youtube.com' and
url.path() == '/get_video_info' and
'&adformat=' in url.query()):
info.block()
interce... | 26.517647 | 91 | 0.624667 | import os
import dracula.draw
from qutebrowser.api import interceptor
def filter_yt(info: interceptor.Request):
url = info.request_url
if (url.host() == 'www.youtube.com' and
url.path() == '/get_video_info' and
'&adformat=' in url.query()):
info.block()
interceptor.register(filter_yt)
config.load_autocon... | true | true |
1c45d042e89a5bb966939c08622d51ac265a1ecd | 3,127 | py | Python | tmt/steps/report/junit.py | KwisatzHaderach/tmt | 75ff90a543240d39c45baa849e6a3149545be0fd | [
"MIT"
] | null | null | null | tmt/steps/report/junit.py | KwisatzHaderach/tmt | 75ff90a543240d39c45baa849e6a3149545be0fd | [
"MIT"
] | null | null | null | tmt/steps/report/junit.py | KwisatzHaderach/tmt | 75ff90a543240d39c45baa849e6a3149545be0fd | [
"MIT"
] | null | null | null | import os
import click
import tmt
import tmt.steps.report
DEFAULT_NAME = "junit.xml"
def import_junit_xml():
"""
Import junit_xml module only when needed
Until we have a separate package for each plugin.
"""
global junit_xml
try:
import junit_xml
except ImportError:
rai... | 30.960396 | 79 | 0.568276 | import os
import click
import tmt
import tmt.steps.report
DEFAULT_NAME = "junit.xml"
def import_junit_xml():
global junit_xml
try:
import junit_xml
except ImportError:
raise tmt.utils.ReportError(
"Missing 'junit-xml', fixable by 'pip install tmt[report-junit]'.")
def dura... | true | true |
1c45d09ac800551f95112d696ee3ba6ef9d53511 | 5,786 | py | Python | packaging/dicarlo/sanghavi/sanghavimurty2020things1.py | dmayo/brain-score | 3ab4258152c9e3f8c7d29afb10158b184dbcebbe | [
"MIT"
] | 52 | 2019-12-13T06:43:44.000Z | 2022-02-21T07:47:39.000Z | packaging/dicarlo/sanghavi/sanghavimurty2020things1.py | dmayo/brain-score | 3ab4258152c9e3f8c7d29afb10158b184dbcebbe | [
"MIT"
] | 104 | 2019-12-06T18:08:54.000Z | 2022-03-31T23:57:51.000Z | packaging/dicarlo/sanghavi/sanghavimurty2020things1.py | dmayo/brain-score | 3ab4258152c9e3f8c7d29afb10158b184dbcebbe | [
"MIT"
] | 32 | 2019-12-05T14:31:14.000Z | 2022-03-10T02:04:45.000Z | import os
from pathlib import Path
import json
import numpy as np
import xarray as xr
import pandas as pd
from brainio_base.assemblies import NeuronRecordingAssembly
from brainio_base.stimuli import StimulusSet
from brainio_collection.packaging import package_data_assembly, package_stimulus_set
from mkgu_packaging.di... | 48.621849 | 125 | 0.667128 | import os
from pathlib import Path
import json
import numpy as np
import xarray as xr
import pandas as pd
from brainio_base.assemblies import NeuronRecordingAssembly
from brainio_base.stimuli import StimulusSet
from brainio_collection.packaging import package_data_assembly, package_stimulus_set
from mkgu_packaging.di... | true | true |
1c45d15d423872579297a22d537eec56230d8c1c | 197 | py | Python | Aprendendo Python/cursopythonudamy/aula16while_contador_acumulador.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | Aprendendo Python/cursopythonudamy/aula16while_contador_acumulador.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | Aprendendo Python/cursopythonudamy/aula16while_contador_acumulador.py | JlucasS777/Aprendendo-Python | a3a960260070f0d604c27fbbc41578a6ab11edb5 | [
"MIT"
] | null | null | null | contador = 1
acumulador = 1
while contador <= 10:
print(contador,acumulador)
if contador>5:
break
contador+=1
else :
print("Cheguei ao final do programa e usei o laço else") | 21.888889 | 60 | 0.659898 | contador = 1
acumulador = 1
while contador <= 10:
print(contador,acumulador)
if contador>5:
break
contador+=1
else :
print("Cheguei ao final do programa e usei o laço else") | true | true |
1c45d36bee4e9d54b5cbf2aeacd682f4ac03ae3c | 1,228 | py | Python | scipy/special/_precompute/utils.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | 1 | 2020-02-26T12:15:51.000Z | 2020-02-26T12:15:51.000Z | scipy/special/_precompute/utils.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | null | null | null | scipy/special/_precompute/utils.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, print_function, absolute_import
from numpy.testing import suppress_warnings
try:
import mpmath as mp
except ImportError:
pass
try:
# Can remove when sympy #11255 is resolved; see
# https://github.com/sympy/sympy/issues/11255
with suppress_warnings() as sup:
... | 26.12766 | 76 | 0.593648 | from __future__ import division, print_function, absolute_import
from numpy.testing import suppress_warnings
try:
import mpmath as mp
except ImportError:
pass
try:
with suppress_warnings() as sup:
sup.filter(DeprecationWarning, "inspect.getargspec.. is deprecated")
from sympy.abc ... | true | true |
1c45d3b6ea710c0f740d2889df7c9d12df1dfe29 | 405 | py | Python | minesweeperapi/minesweeperapi/wsgi.py | Olaussen/minesweeper-online-api | 36ba250b65b19cc4f0d8be36b3f84faf3f692035 | [
"MIT"
] | 4 | 2020-04-15T18:21:36.000Z | 2020-04-24T12:24:03.000Z | minesweeperapi/minesweeperapi/wsgi.py | Olaussen/minesweeper-online-api | 36ba250b65b19cc4f0d8be36b3f84faf3f692035 | [
"MIT"
] | 4 | 2021-03-29T23:56:40.000Z | 2021-09-22T19:00:36.000Z | minesweeperapi/minesweeperapi/wsgi.py | Angstboksen/minesweeper-online-api | 36ba250b65b19cc4f0d8be36b3f84faf3f692035 | [
"MIT"
] | null | null | null | """
WSGI config for minesweeperapi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'minesweeperapi.settings')
application = get_wsgi_application()
| true | true |
1c45d4943574fa4c951c551453898c091153b659 | 1,917 | py | Python | trax/rl/__init__.py | koz4k2/trax | 548f671fa3804cb86154ac504fb0c6c4269b42c7 | [
"Apache-2.0"
] | 2 | 2020-02-05T09:27:29.000Z | 2020-02-05T09:27:49.000Z | trax/rl/__init__.py | koz4k2/trax | 548f671fa3804cb86154ac504fb0c6c4269b42c7 | [
"Apache-2.0"
] | null | null | null | trax/rl/__init__.py | koz4k2/trax | 548f671fa3804cb86154ac504fb0c6c4269b42c7 | [
"Apache-2.0"
] | 1 | 2021-07-08T16:35:30.000Z | 2021-07-08T16:35:30.000Z | # coding=utf-8
# Copyright 2019 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.169811 | 79 | 0.806468 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gin
from trax.rl import simulated_env_problem
def configure_rl(*args, **kwargs):
kwargs['module'] = 'trax.rl'
return gin.external_configurable(*args, **kwargs)
def configure_simulated_env_prob... | true | true |
1c45d52d487074570c308737c78dd22714356d93 | 4,508 | py | Python | play_with_mpv.py | davehorner/play-with-mpv | 89ad8de0faf10a175fbd8cf0792706e39ed87fae | [
"Unlicense"
] | null | null | null | play_with_mpv.py | davehorner/play-with-mpv | 89ad8de0faf10a175fbd8cf0792706e39ed87fae | [
"Unlicense"
] | null | null | null | play_with_mpv.py | davehorner/play-with-mpv | 89ad8de0faf10a175fbd8cf0792706e39ed87fae | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Plays MPV when instructed to by a chrome extension =]
import sys
import argparse
from subprocess import Popen
FileNotFoundError = IOError
if sys.version_info[0] < 3: # python 2
import BaseHTTPServer
import urlparse
class CompatibilityMixin:
def send_body(self, msg):
... | 37.566667 | 160 | 0.533718 |
import sys
import argparse
from subprocess import Popen
FileNotFoundError = IOError
if sys.version_info[0] < 3: import BaseHTTPServer
import urlparse
class CompatibilityMixin:
def send_body(self, msg):
self.wfile.write(msg+'\n')
self.wfile.close()
else: import http.s... | true | true |
1c45d5350b388a12e7757dc666f9344c210a8547 | 42,275 | py | Python | pypy/module/_winreg/interp_winreg.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/_winreg/interp_winreg.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/_winreg/interp_winreg.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib import rwinreg, rwin32, rstring
from rpython.rlib.rarithmetic import r_uint, r_ulonglong, intmask
from rpython.rlib.buffer import ByteBuffer
from rpython.rlib.rutf8 import check_utf8
from pypy.interpreter.baseobjspace import W_Root, BufferInterface... | 41.527505 | 91 | 0.649415 | from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib import rwinreg, rwin32, rstring
from rpython.rlib.rarithmetic import r_uint, r_ulonglong, intmask
from rpython.rlib.buffer import ByteBuffer
from rpython.rlib.rutf8 import check_utf8
from pypy.interpreter.baseobjspace import W_Root, BufferInterface... | true | true |
1c45d8033a8532a5310eb7b5b6868e1725ae9e8a | 1,188 | py | Python | profiles_api/serializers.py | vikrantgautam/profiles-rest-api | 68abd9398f04de6eb87357b997dd438b6503f8ea | [
"MIT"
] | null | null | null | profiles_api/serializers.py | vikrantgautam/profiles-rest-api | 68abd9398f04de6eb87357b997dd438b6503f8ea | [
"MIT"
] | null | null | null | profiles_api/serializers.py | vikrantgautam/profiles-rest-api | 68abd9398f04de6eb87357b997dd438b6503f8ea | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""Serializes a name field for testing our APIView"""
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
"""Serializes a user profile ... | 28.285714 | 68 | 0.625421 | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = models.UserProfile
fields = ('id', 'email', 'name'... | true | true |
1c45d82e9f5994d25e1d89ebc33ba778c614bf38 | 1,850 | py | Python | weasyl/cron.py | theSeracen/weasyl | c13b4f61f559ce44bfaee027ffc59a1379d25f3e | [
"Apache-2.0"
] | null | null | null | weasyl/cron.py | theSeracen/weasyl | c13b4f61f559ce44bfaee027ffc59a1379d25f3e | [
"Apache-2.0"
] | 148 | 2021-03-16T07:40:05.000Z | 2022-03-21T08:14:46.000Z | weasyl/cron.py | theSeracen/weasyl | c13b4f61f559ce44bfaee027ffc59a1379d25f3e | [
"Apache-2.0"
] | null | null | null | import arrow
from twisted.python import log
from weasyl.define import engine
from weasyl import index, submission
def run_periodic_tasks():
# An arrow object representing the current UTC time
now = arrow.utcnow()
db = engine.connect()
with db.begin():
locked = db.scalar("SELECT pg_try_adviso... | 33.035714 | 76 | 0.58973 | import arrow
from twisted.python import log
from weasyl.define import engine
from weasyl import index, submission
def run_periodic_tasks():
now = arrow.utcnow()
db = engine.connect()
with db.begin():
locked = db.scalar("SELECT pg_try_advisory_xact_lock(0)")
if not locked:
... | true | true |
1c45d908aa737c8cc2b138b76e17ef1a9a3d56e4 | 871 | py | Python | evennia/commands/default/cmdset_unloggedin.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | 3 | 2019-08-08T16:58:25.000Z | 2019-10-12T07:31:36.000Z | evennia/commands/default/cmdset_unloggedin.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | 9 | 2019-09-06T18:21:59.000Z | 2022-01-13T03:04:11.000Z | evennia/commands/default/cmdset_unloggedin.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | 2 | 2019-09-02T08:39:24.000Z | 2019-09-02T18:39:32.000Z | """
This module describes the unlogged state of the default game.
The setting STATE_UNLOGGED should be set to the python path
of the state instance in this module.
"""
from evennia.commands.cmdset import CmdSet
from evennia.commands.default import unloggedin
class UnloggedinCmdSet(CmdSet):
"""
Sets up the unl... | 32.259259 | 61 | 0.72101 | from evennia.commands.cmdset import CmdSet
from evennia.commands.default import unloggedin
class UnloggedinCmdSet(CmdSet):
key = "DefaultUnloggedin"
priority = 0
def at_cmdset_creation(self):
self.add(unloggedin.CmdUnconnectedConnect())
self.add(unloggedin.CmdUnconnectedCreate())
... | true | true |
1c45db6d3cecdc6f61c22f43e5bb581f20cf7a6b | 2,437 | py | Python | naeval/ner/models/tomita.py | sdspieg/naeval | 52c4a508bf212b95d4e610cfe1b5e23b8ca94d2f | [
"MIT"
] | 36 | 2020-03-22T09:37:10.000Z | 2022-01-17T14:49:30.000Z | naeval/ner/models/tomita.py | sdspieg/naeval | 52c4a508bf212b95d4e610cfe1b5e23b8ca94d2f | [
"MIT"
] | 11 | 2020-03-25T09:39:45.000Z | 2020-08-16T05:37:02.000Z | naeval/ner/models/tomita.py | sdspieg/naeval | 52c4a508bf212b95d4e610cfe1b5e23b8ca94d2f | [
"MIT"
] | 6 | 2020-05-16T05:52:04.000Z | 2022-01-16T06:45:29.000Z |
from naeval.const import TOMITA, PER
from naeval.record import Record
from naeval.io import parse_xml
from naeval.span import Span
from ..adapt import adapt_tomita
from ..markup import Markup
from .base import Model, post
TOMITA_IMAGE = 'natasha/tomita-algfio'
TOMITA_CONTAINER_PORT = 8080
TOMITA_URL = 'http://{hos... | 24.867347 | 61 | 0.622487 |
from naeval.const import TOMITA, PER
from naeval.record import Record
from naeval.io import parse_xml
from naeval.span import Span
from ..adapt import adapt_tomita
from ..markup import Markup
from .base import Model, post
TOMITA_IMAGE = 'natasha/tomita-algfio'
TOMITA_CONTAINER_PORT = 8080
TOMITA_URL = 'http://{hos... | true | true |
1c45dbebdbe4e22104a31a6023c49fc2d26290c2 | 10,611 | py | Python | src/cargrid.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | src/cargrid.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | src/cargrid.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | """
Module which defines the car agents
"""
from mesa import Agent
import numpy as np
class Car(Agent):
"""
Class which defines the inidividual car agents.
Each car has a specific unique_id and an index which is the
unique_id modulo the resolution of the LaneSpace.
Attributes:
unique_id (... | 43.310204 | 90 | 0.577985 | from mesa import Agent
import numpy as np
class Car(Agent):
def __init__(self, unique_id, model, start_lane,
speed, agression, min_gap):
super().__init__(unique_id, model)
self.start_lane = start_lane
self.index = self.unique_id % model.grid.length
self.po... | true | true |
1c45dc41168fc46b895c51c21cd20daa9a2082ba | 5,247 | py | Python | splink/intuition.py | rubensmau/splink | da4f5d5bc09753b6c6974af308dd1bad324d9b4b | [
"MIT"
] | 176 | 2020-03-16T15:19:39.000Z | 2022-03-30T06:38:29.000Z | splink/intuition.py | rubensmau/splink | da4f5d5bc09753b6c6974af308dd1bad324d9b4b | [
"MIT"
] | 194 | 2020-03-01T21:32:26.000Z | 2022-03-30T14:58:38.000Z | splink/intuition.py | rubensmau/splink | da4f5d5bc09753b6c6974af308dd1bad324d9b4b | [
"MIT"
] | 25 | 2020-03-07T00:09:22.000Z | 2022-03-11T16:28:06.000Z | from .model import Model
from .charts import load_chart_definition, altair_if_installed_else_json
import pandas as pd
from math import log2
initial_template = """
Initial probability of match (prior) = λ = {lam:.4g}
"""
col_template = [
("Comparison of {column_name}. Values are:", ""),
("{column_name}_l:",... | 37.478571 | 203 | 0.692014 | from .model import Model
from .charts import load_chart_definition, altair_if_installed_else_json
import pandas as pd
from math import log2
initial_template = """
Initial probability of match (prior) = λ = {lam:.4g}
"""
col_template = [
("Comparison of {column_name}. Values are:", ""),
("{column_name}_l:",... | true | true |
1c45dd33925b9b9be524163ed7fb322778cad0d2 | 1,395 | py | Python | graph_scripts/identification_graph.py | karannewatia/Mycelium | c20deab29d97025d7623af4bbf97f79f3132b415 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 3 | 2022-01-19T18:14:42.000Z | 2022-02-07T19:16:17.000Z | graph_scripts/identification_graph.py | karannewatia/Mycelium | c20deab29d97025d7623af4bbf97f79f3132b415 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | graph_scripts/identification_graph.py | karannewatia/Mycelium | c20deab29d97025d7623af4bbf97f79f3132b415 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
malice_vals = [0.005, 0.01, 0.02, 0.04]
ind = np.arange(4)
#replace these with the data obtained from identification.py
k2r1 = [0.0, 0.0, 0.0008000000000000229, 0.0015999999999999348]
k2r2 = [0.0, ... | 36.710526 | 79 | 0.682437 | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
malice_vals = [0.005, 0.01, 0.02, 0.04]
ind = np.arange(4)
k2r1 = [0.0, 0.0, 0.0008000000000000229, 0.0015999999999999348]
k2r2 = [0.0, 0.0, 0.0008000000000000229, 0.0033000000000004137]
k2r3 = [0.... | true | true |
1c45dd47cd5d01f117d4d2dabd7d739958d96331 | 1,591 | py | Python | setup.py | arpitban/integrate | c991a50546229c2341ad5d8571c72c819c06c4b2 | [
"MIT"
] | null | null | null | setup.py | arpitban/integrate | c991a50546229c2341ad5d8571c72c819c06c4b2 | [
"MIT"
] | null | null | null | setup.py | arpitban/integrate | c991a50546229c2341ad5d8571c72c819c06c4b2 | [
"MIT"
] | null | null | null | """
integrate
Package to integrate functions
"""
from setuptools import setup
import versioneer
DOCLINES = __doc__.split("\n")
setup(
# Self-descriptive entries which should always be present
name='integrate',
author='Arpit Bansal',
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:])... | 34.586957 | 118 | 0.657448 | from setuptools import setup
import versioneer
DOCLINES = __doc__.split("\n")
setup(
name='integrate',
author='Arpit Bansal',
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:]),
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
license='MIT',
inst... | true | true |
1c45dd9a6f5f623f74d785fbdbad56a08b56d3f5 | 2,746 | py | Python | xknx/remote_value/remote_value_control.py | magicbear/xknx | e6fe7bbd292e0fee29b2c4f210aff3031d76539d | [
"MIT"
] | 1 | 2021-01-24T21:08:36.000Z | 2021-01-24T21:08:36.000Z | xknx/remote_value/remote_value_control.py | magicbear/xknx | e6fe7bbd292e0fee29b2c4f210aff3031d76539d | [
"MIT"
] | 54 | 2021-10-01T17:42:16.000Z | 2022-03-31T09:22:46.000Z | xknx/remote_value/remote_value_control.py | crazyfx1/xknx | 87666cc9bd9da64a84305baeff84486097346111 | [
"MIT"
] | null | null | null | """
Module for managing a control remote value.
Examples are switching commands with priority control, relative dimming or blinds control commands.
DPT 2.yyy and DPT 3.yyy
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from xknx.dpt import DPTArray, DPTBinary, DPTControlStepCode
from xk... | 36.131579 | 100 | 0.664967 | from __future__ import annotations
from typing import TYPE_CHECKING, Any
from xknx.dpt import DPTArray, DPTBinary, DPTControlStepCode
from xknx.exceptions import ConversionError
from .remote_value import AsyncCallbackType, GroupAddressesType, RemoteValue
if TYPE_CHECKING:
from xknx.xknx import XKNX
class Remo... | true | true |
1c45dde6f471e6c02e753f85eac93a9d22fbde55 | 3,277 | py | Python | sphinx/pocketsphinx-5prealpha/swig/python/test/decoder_test.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 2 | 2021-01-13T21:17:42.000Z | 2021-01-13T21:17:42.000Z | sphinx/pocketsphinx-5prealpha/swig/python/test/decoder_test.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | null | null | null | sphinx/pocketsphinx-5prealpha/swig/python/test/decoder_test.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | null | null | null | # ====================================================================
# Copyright (c) 2013 Carnegie Mellon University. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of... | 38.552941 | 121 | 0.712237 |
from os import environ, path
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
MODELDIR = "../../../model"
DATADIR = "../../../test/data"
config = Decoder.default_config()
config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us'))
config.set_string('-lm', path.join(MODELDIR, 'en-us/en... | true | true |
1c45ddeda1ba48e329cee4025e6983697c5c5850 | 512 | py | Python | scipy/sparse/linalg/setup.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 9,095 | 2015-01-02T18:24:23.000Z | 2022-03-31T20:35:31.000Z | scipy/sparse/linalg/setup.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 11,500 | 2015-01-01T01:15:30.000Z | 2022-03-31T23:07:35.000Z | scipy/sparse/linalg/setup.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 5,838 | 2015-01-05T11:56:42.000Z | 2022-03-31T23:21:19.000Z |
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linalg', parent_package, top_path)
config.add_subpackage('_isolve')
config.add_subpackage('_dsolve')
config.add_subpackage('_eigen')
config.add_data_dir('tests')
... | 23.272727 | 62 | 0.71875 |
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linalg', parent_package, top_path)
config.add_subpackage('_isolve')
config.add_subpackage('_dsolve')
config.add_subpackage('_eigen')
config.add_data_dir('tests')
... | true | true |
1c45de15d7b5493f204a2593fa32d8e68e6eccbf | 612 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/GREMEDY/string_marker.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/GREMEDY/string_marker.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/GREMEDY/string_marker.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import... | 34 | 119 | 0.776144 | from OpenGL import platform as _p, arrays
from OpenGL.raw.GL import _types as _cs
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_GREMEDY_string_marker'
def _f( function ):
return _p.createFunction( functio... | true | true |
1c45decc0c487ca311ecba9f0e1ff22edc6b5a52 | 10,437 | bzl | Python | tools/build_defs/repo/git.bzl | FengRillian/bazel | c962975f152e30741a3affb1d41dd885543bbea6 | [
"Apache-2.0"
] | 3 | 2019-03-18T23:49:16.000Z | 2021-05-30T09:44:18.000Z | tools/build_defs/repo/git.bzl | FengRillian/bazel | c962975f152e30741a3affb1d41dd885543bbea6 | [
"Apache-2.0"
] | null | null | null | tools/build_defs/repo/git.bzl | FengRillian/bazel | c962975f152e30741a3affb1d41dd885543bbea6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The Bazel 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 applicable la... | 38.655556 | 107 | 0.678547 |
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch", "update_attrs", "workspace_and_buildfile")
def _clone_or_update(ctx):
if ((not ctx.attr.tag and not ctx.attr.commit and not ctx.attr.branch) or
(ctx.attr.tag and ctx.attr.commit) or
(ctx.attr.tag and ctx.attr.branch) or
(ctx.at... | true | true |
1c45dee6a500635eabaad87541b2131f941e9a46 | 69,722 | py | Python | kgtk/io/kgtkreader.py | dgarijo/kgtk | f624754e91afbad8d28006e716189b43d367ef04 | [
"MIT"
] | null | null | null | kgtk/io/kgtkreader.py | dgarijo/kgtk | f624754e91afbad8d28006e716189b43d367ef04 | [
"MIT"
] | null | null | null | kgtk/io/kgtkreader.py | dgarijo/kgtk | f624754e91afbad8d28006e716189b43d367ef04 | [
"MIT"
] | null | null | null | """Read a KGTK node or edge file in TSV format.
Normally, results are obtained as rows of string values obtained by iteration
on the KgtkReader object. Alternative iterators are available to return the results
as:
* concise_rows: lists of strings with empty fields converted to None
* kgtk_values:... | 49.238701 | 188 | 0.586486 |
from argparse import ArgumentParser, _ArgumentGroup, Namespace, SUPPRESS
import attr
import bz2
from enum import Enum
import gzip
import lz4 import lzma
from multiprocessing import Process, Queue
from pathlib import Path
import sys
import typing
from kgtk.kgtkformat import KgtkFormat
from kgtk.io.kgtkbase import Kgtk... | true | true |
1c45e033fc674af02e4beaed1d9dd8f01d305f9a | 686 | py | Python | app/core/management/commands/wait_for_db.py | amir-rz/recipe-app-api | 69f8c2ee801cd4bf909979bd246b8fe1bf9e2d60 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | amir-rz/recipe-app-api | 69f8c2ee801cd4bf909979bd246b8fe1bf9e2d60 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | amir-rz/recipe-app-api | 69f8c2ee801cd4bf909979bd246b8fe1bf9e2d60 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
""" Django command to pause excuation until database is available """
def handle(self, *args, **options):
self.stdout.write("Wait... | 34.3 | 82 | 0.650146 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write("Waiting for database...")
db_conn = None
while not db_conn:
... | true | true |
1c45e09129bfd3cd066e0bd3ca94b7df369924d0 | 962 | py | Python | atriage/collectors/flatdir.py | Ayrx/atriage | 6e928da0d673260e61e089f69cb56555c7d9cdf6 | [
"Apache-2.0"
] | 11 | 2017-12-17T12:18:56.000Z | 2021-05-10T23:11:29.000Z | atriage/collectors/flatdir.py | Ayrx/atriage | 6e928da0d673260e61e089f69cb56555c7d9cdf6 | [
"Apache-2.0"
] | 7 | 2018-10-01T08:46:24.000Z | 2021-06-01T21:48:44.000Z | atriage/collectors/flatdir.py | Ayrx/atriage | 6e928da0d673260e61e089f69cb56555c7d9cdf6 | [
"Apache-2.0"
] | 3 | 2017-12-17T12:19:00.000Z | 2019-03-25T09:31:52.000Z | from atriage.collectors.exceptions import NoopException
from atriage.collectors.interface import CollectorInterface
from pathlib import Path
import click
class FlatDirCollector(object):
name = "flat-dir-collector"
def __init__(self, results):
self._results = results
def parse_directory(self, ... | 24.05 | 62 | 0.660083 | from atriage.collectors.exceptions import NoopException
from atriage.collectors.interface import CollectorInterface
from pathlib import Path
import click
class FlatDirCollector(object):
name = "flat-dir-collector"
def __init__(self, results):
self._results = results
def parse_directory(self, ... | true | true |
1c45e18204e4eaacee40b946650e58bb8faf467c | 2,264 | py | Python | email/sphinxcontrib/email.py | Tommy1969/sphinx-contrib | d479ece0fe6c2f33bbebcc52677035d5003b7b35 | [
"BSD-2-Clause"
] | 14 | 2016-02-22T12:06:54.000Z | 2021-01-05T07:01:43.000Z | email/sphinxcontrib/email.py | SuperKogito/sphinx-contrib | 3b643bffb90a27ae378717ae6335873a0e73cf9d | [
"BSD-2-Clause"
] | 8 | 2015-03-06T13:46:49.000Z | 2019-10-09T08:53:14.000Z | email/sphinxcontrib/email.py | SuperKogito/sphinx-contrib | 3b643bffb90a27ae378717ae6335873a0e73cf9d | [
"BSD-2-Clause"
] | 16 | 2015-05-25T02:51:05.000Z | 2020-01-17T05:49:47.000Z | # E-mail obfuscation role for Sphinx.
from docutils import nodes
# The obfuscation code was taken from
#
# http://pypi.python.org/pypi/bud.nospam
#
# and was was released by Kevin Teague <kevin at bud ca> under
# a BSD license.
import re
try:
maketrans = ''.maketrans
except AttributeError:
# fallback for ... | 27.277108 | 76 | 0.605124 |
from docutils import nodes
import re
try:
maketrans = ''.maketrans
except AttributeError:
from string import maketrans
rot_13_trans = maketrans(
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm'
)
def rot_13_encrypt(line):
line =... | true | true |
1c45e1cfb9f789049e129d5f970c555b0f0ffd3c | 15,669 | py | Python | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | import logging
from collections import defaultdict, deque
from math import log2
from time import time
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from .comm.addressing import get_address_host
from .core import CommClosedError
from .diagnostics.p... | 34.286652 | 88 | 0.521029 | import logging
from collections import defaultdict, deque
from math import log2
from time import time
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from .comm.addressing import get_address_host
from .core import CommClosedError
from .diagnostics.p... | true | true |
1c45e29f710037c91f2e554142171caeedf3bf05 | 4,923 | py | Python | src/lidar.py | steviet91/furmulaone_source | ca738b271fa346da4234c5ffc781abc12a5ac49f | [
"MIT"
] | null | null | null | src/lidar.py | steviet91/furmulaone_source | ca738b271fa346da4234c5ffc781abc12a5ac49f | [
"MIT"
] | 24 | 2020-04-14T12:38:07.000Z | 2020-04-29T08:18:33.000Z | src/lidar.py | steviet91/furmulaone_source | ca738b271fa346da4234c5ffc781abc12a5ac49f | [
"MIT"
] | null | null | null | import numpy as np
from .track import TrackHandler
from .geom import Line
from .geom import Circle
from .geom import get_intersection_point_lineseg_lineseg
from .geom import calc_euclid_distance_2d
from .geom import rotate_point
import time
#from multiprocessing import Pool
class Lidar(object):
"""
Object ... | 33.719178 | 97 | 0.589681 | import numpy as np
from .track import TrackHandler
from .geom import Line
from .geom import Circle
from .geom import get_intersection_point_lineseg_lineseg
from .geom import calc_euclid_distance_2d
from .geom import rotate_point
import time
class Lidar(object):
_NRays = 3
_xLidarRange = float(200)
def __i... | true | true |
1c45e2b8f9e20b2f3b7d0e052c8fd311816a6a16 | 1,984 | py | Python | carball/analysis2/stats/demo_stats.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | carball/analysis2/stats/demo_stats.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | carball/analysis2/stats/demo_stats.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
from typing import Dict, List
import numpy as np
import pandas as pd
from api.analysis.stats_pb2 import PlayerStats
from api.events.demo_pb2 import Demo
from api.game.game_pb2 import Game
from carball.analysis2.constants.constants import FIELD_Y_LIM, FIELD_X_LIM
def set_demo_stats(pl... | 39.68 | 112 | 0.720766 | from collections import Counter
from typing import Dict, List
import numpy as np
import pandas as pd
from api.analysis.stats_pb2 import PlayerStats
from api.events.demo_pb2 import Demo
from api.game.game_pb2 import Game
from carball.analysis2.constants.constants import FIELD_Y_LIM, FIELD_X_LIM
def set_demo_stats(pl... | true | true |
1c45e33ca52708a7eea05a4c0e1c5e724e56f6ba | 3,556 | py | Python | deploytesting/settings.py | mouaadBenAllal/deploytest | 1011152d3a00879f450db3deaef64dee7c9009c0 | [
"Apache-2.0"
] | null | null | null | deploytesting/settings.py | mouaadBenAllal/deploytest | 1011152d3a00879f450db3deaef64dee7c9009c0 | [
"Apache-2.0"
] | null | null | null | deploytesting/settings.py | mouaadBenAllal/deploytest | 1011152d3a00879f450db3deaef64dee7c9009c0 | [
"Apache-2.0"
] | null | null | null | """
Django settings for deploytesting project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
imp... | 28.448 | 102 | 0.708661 |
import os
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', '!5+^n3g458fs0#x8=142wf+5xqkw2)nb5^_zkry-g2fl&8@rn_')
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# DEBUG = True
DEBUG = bool(os.environ.get('DJANGO_DEBUG', True))
ALLOWED_HOSTS = ['Mouaadben.pythonanywhere.com']
# Application ... | true | true |
1c45e454061369b7ef00827dbb014ceacea5b029 | 212 | py | Python | lambdata_andrewarnett/__init__.py | AndrewArnett/lambdata | fe7e2694a0a099f9df88807f744556c230e9f18d | [
"MIT"
] | null | null | null | lambdata_andrewarnett/__init__.py | AndrewArnett/lambdata | fe7e2694a0a099f9df88807f744556c230e9f18d | [
"MIT"
] | null | null | null | lambdata_andrewarnett/__init__.py | AndrewArnett/lambdata | fe7e2694a0a099f9df88807f744556c230e9f18d | [
"MIT"
] | 1 | 2020-08-04T19:20:50.000Z | 2020-08-04T19:20:50.000Z | """
lambdata - a collection of Data Science helper functions
"""
import pandas as pd
import numpy as np
from lambdata_andrewarnett.dataframe_helper import shape_head, baseline
TEST = pd.DataFrame(np.ones(10))
| 19.272727 | 71 | 0.783019 |
import pandas as pd
import numpy as np
from lambdata_andrewarnett.dataframe_helper import shape_head, baseline
TEST = pd.DataFrame(np.ones(10))
| true | true |
1c45e47eae4c91731680b35fa0da9f2d7d523680 | 10,928 | py | Python | mindmeld/components/_elasticsearch_helpers.py | jre21/mindmeld | 6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81 | [
"Apache-2.0"
] | 1 | 2021-01-06T23:39:57.000Z | 2021-01-06T23:39:57.000Z | mindmeld/components/_elasticsearch_helpers.py | jre21/mindmeld | 6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81 | [
"Apache-2.0"
] | 1 | 2021-02-02T22:53:01.000Z | 2021-02-02T22:53:01.000Z | mindmeld/components/_elasticsearch_helpers.py | jre21/mindmeld | 6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 46.901288 | 99 | 0.685212 |
import os
import logging
from elasticsearch5 import (Elasticsearch, ImproperlyConfigured, ElasticsearchException,
ConnectionError as EsConnectionError, TransportError)
from elasticsearch5.helpers import streaming_bulk
from tqdm import tqdm
from ._config import DEFAULT_ES_INDEX_TEMPLATE, D... | true | true |
1c45e48a779bc28e0a8409233594b33b5c303ad5 | 376 | py | Python | test/test_ynab.py | quinnhosler/ynab-sdk-python | 4ef8040bb44216212a84c8990329dcf63972e0fa | [
"Apache-2.0"
] | null | null | null | test/test_ynab.py | quinnhosler/ynab-sdk-python | 4ef8040bb44216212a84c8990329dcf63972e0fa | [
"Apache-2.0"
] | null | null | null | test/test_ynab.py | quinnhosler/ynab-sdk-python | 4ef8040bb44216212a84c8990329dcf63972e0fa | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from test.support.dummy_client import DummyClient
from ynab_sdk import YNAB
class YNABTest(TestCase):
ynab: YNAB
client: DummyClient
def setUp(self):
self.client = DummyClient()
self.ynab = YNAB(client=self.client)
def test_client_requires_key_or_client... | 22.117647 | 49 | 0.728723 | from unittest import TestCase
from test.support.dummy_client import DummyClient
from ynab_sdk import YNAB
class YNABTest(TestCase):
ynab: YNAB
client: DummyClient
def setUp(self):
self.client = DummyClient()
self.ynab = YNAB(client=self.client)
def test_client_requires_key_or_client... | true | true |
1c45e570f903cc0c5df4101b24907713afacfe1b | 1,034 | py | Python | test/app/all_tests.py | chuyqa/pydoop | 575f56cc66381fef08981a2452acde02bddf0363 | [
"Apache-2.0"
] | 1 | 2021-03-22T02:22:30.000Z | 2021-03-22T02:22:30.000Z | test/app/all_tests.py | chuyqa/pydoop | 575f56cc66381fef08981a2452acde02bddf0363 | [
"Apache-2.0"
] | null | null | null | test/app/all_tests.py | chuyqa/pydoop | 575f56cc66381fef08981a2452acde02bddf0363 | [
"Apache-2.0"
] | null | null | null | # BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 agree... | 26.512821 | 77 | 0.737911 |
import unittest
from pydoop.test_utils import get_module
TEST_MODULE_NAMES = [
'test_submit',
]
def suite(path=None):
suites = []
for module in TEST_MODULE_NAMES:
suites.append(get_module(module, path).suite())
return unittest.TestSuite(suites)
if __name__ == '__main__':
import sys
... | true | true |
1c45e61545b2b62f4211d66f7c74da507f7af9e4 | 15,352 | py | Python | tests/unit/test_hooks.py | i386x/tox-lsr | 22f4d63d58050b1c1bee2e91eb239c31f35cfd13 | [
"MIT"
] | null | null | null | tests/unit/test_hooks.py | i386x/tox-lsr | 22f4d63d58050b1c1bee2e91eb239c31f35cfd13 | [
"MIT"
] | null | null | null | tests/unit/test_hooks.py | i386x/tox-lsr | 22f4d63d58050b1c1bee2e91eb239c31f35cfd13 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
#
"""Tests for tox_lsr hooks."""
import os
import shutil
import tempfile
try:
from unittest import mock as unittest_mock
from unittest.mock import MagicMock, Mock, patch
except ImportError:
impor... | 36.293144 | 79 | 0.572108 |
import os
import shutil
import tempfile
try:
from unittest import mock as unittest_mock
from unittest.mock import MagicMock, Mock, patch
except ImportError:
import mock as unittest_mock
from mock import MagicMock, Mock, patch
from copy import deepcopy
import pkg_resources
import py.iniconfig
import... | true | true |
1c45e7af81826e60de1299cc184fcbaf42464f56 | 3,170 | py | Python | lists/tests/test_models.py | brendanodwyer/python-tdd-book | ff3a8a8254a3112937ce9924dfa05ba52069c8bf | [
"Apache-2.0"
] | null | null | null | lists/tests/test_models.py | brendanodwyer/python-tdd-book | ff3a8a8254a3112937ce9924dfa05ba52069c8bf | [
"Apache-2.0"
] | null | null | null | lists/tests/test_models.py | brendanodwyer/python-tdd-book | ff3a8a8254a3112937ce9924dfa05ba52069c8bf | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase
from lists.models import Item
from lists.models import List
User = get_user_model()
class ItemModelTest(TestCase):
def test_default_text(self):
item = Item()
self.as... | 34.086022 | 73 | 0.667508 | from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase
from lists.models import Item
from lists.models import List
User = get_user_model()
class ItemModelTest(TestCase):
def test_default_text(self):
item = Item()
self.as... | true | true |
1c45e7bb27a310e77f8849bbd05bd8e62fc757bb | 12,127 | py | Python | core/domain/caching_services.py | prayutsu/oppia | e82da7653f7bbfb9ded0e1ba16cd9f481ff5a786 | [
"Apache-2.0"
] | 2 | 2020-10-13T12:59:08.000Z | 2020-10-13T17:10:26.000Z | core/domain/caching_services.py | gitter-badger/oppia | 7d8e659264582d7ce74bc6c139e597b82bca0e04 | [
"Apache-2.0"
] | 35 | 2019-02-23T20:31:21.000Z | 2019-08-19T12:32:13.000Z | core/domain/caching_services.py | gitter-badger/oppia | 7d8e659264582d7ce74bc6c139e597b82bca0e04 | [
"Apache-2.0"
] | 1 | 2021-08-13T07:54:56.000Z | 2021-08-13T07:54:56.000Z | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | 45.762264 | 80 | 0.740002 |
from __future__ import absolute_import from __future__ import unicode_literals
import json
from core.domain import collection_domain
from core.domain import exp_domain
from core.domain import platform_parameter_domain
from core.domain import skill_domain
from core.domain import story_domain
from core.domain impor... | true | true |
1c45e7bf89b8194eb005c56d95a2d6c85d741f03 | 326 | py | Python | pa05_find_max.py | jpch89/picalgo | 73aa98e477c68bb39d337914065c0fe1b4bad756 | [
"MIT"
] | null | null | null | pa05_find_max.py | jpch89/picalgo | 73aa98e477c68bb39d337914065c0fe1b4bad756 | [
"MIT"
] | null | null | null | pa05_find_max.py | jpch89/picalgo | 73aa98e477c68bb39d337914065c0fe1b4bad756 | [
"MIT"
] | null | null | null | def find_max(arr):
if len(arr) == 1:
return arr[0]
elif len(arr) == 2:
return arr[0] if arr[0] > arr[1] else arr[1]
first = arr[0]
second = find_max(arr[1:])
return first if first > second else second
if __name__ == '__main__':
arr = [1, 7, 4, 8]
print(find_max(arr))
"""
... | 17.157895 | 52 | 0.53681 | def find_max(arr):
if len(arr) == 1:
return arr[0]
elif len(arr) == 2:
return arr[0] if arr[0] > arr[1] else arr[1]
first = arr[0]
second = find_max(arr[1:])
return first if first > second else second
if __name__ == '__main__':
arr = [1, 7, 4, 8]
print(find_max(arr))
| true | true |
1c45e9e5f64d477f9fcc29374315d1729650f609 | 7,784 | py | Python | tensorflow/tools/pip_package/setup.py | jjzhang166/tensorflow | 61c0b39011671628ee85c2b49bc8845520018aa2 | [
"Apache-2.0"
] | 3 | 2017-05-31T01:33:48.000Z | 2020-02-18T17:12:56.000Z | tensorflow/tools/pip_package/setup.py | jjzhang166/tensorflow | 61c0b39011671628ee85c2b49bc8845520018aa2 | [
"Apache-2.0"
] | null | null | null | tensorflow/tools/pip_package/setup.py | jjzhang166/tensorflow | 61c0b39011671628ee85c2b49bc8845520018aa2 | [
"Apache-2.0"
] | 1 | 2018-12-28T12:55:11.000Z | 2018-12-28T12:55:11.000Z | # 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... | 33.264957 | 80 | 0.675745 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import fnmatch
import os
import re
import sys
from setuptools import find_packages, setup, Command
from setuptools.command.install import install as InstallCommandBase
from setuptools.dist import Distribution... | true | true |
1c45eac1149605f449ce85664d9f605d2ddc6d4b | 14,968 | py | Python | release/python/l2tester/interface.py | gringolito/l2tester | eb8eddad6a9fee33e05e0d8d601229cd704e5464 | [
"MIT"
] | 8 | 2018-04-05T12:05:42.000Z | 2021-07-01T10:44:29.000Z | release/python/l2tester/interface.py | gringolito/l2tester | eb8eddad6a9fee33e05e0d8d601229cd704e5464 | [
"MIT"
] | 6 | 2018-04-05T10:36:31.000Z | 2021-08-08T08:06:13.000Z | release/python/l2tester/interface.py | gringolito/l2tester | eb8eddad6a9fee33e05e0d8d601229cd704e5464 | [
"MIT"
] | 9 | 2018-04-04T19:15:49.000Z | 2021-08-07T10:17:10.000Z |
try:
from pyroute2 import IPRoute
except:
raise Exception("""
l2tester.interface depends on the following module:
* pyroute2 : available at https://pypi.python.org/pypi/pyroute2
Download .tar.gz, extract it, enter folder and run 'sudo python setup.py install' to install this module.
""")
import socket
impor... | 38.183673 | 120 | 0.587654 |
try:
from pyroute2 import IPRoute
except:
raise Exception("""
l2tester.interface depends on the following module:
* pyroute2 : available at https://pypi.python.org/pypi/pyroute2
Download .tar.gz, extract it, enter folder and run 'sudo python setup.py install' to install this module.
""")
import socket
impor... | true | true |
1c45eb2407679dda457ec86794fdeaee8e70ab96 | 90,227 | py | Python | src/reportlab/pdfbase/pdfdoc.py | radjkarl/reportlab | 48cafb6d64ff92fd9d4f9a4dd888be6f7d55b765 | [
"BSD-3-Clause"
] | 51 | 2015-01-20T19:50:34.000Z | 2022-03-05T21:23:32.000Z | src/reportlab/pdfbase/pdfdoc.py | radjkarl/reportlab | 48cafb6d64ff92fd9d4f9a4dd888be6f7d55b765 | [
"BSD-3-Clause"
] | 16 | 2015-11-15T04:23:43.000Z | 2021-09-27T14:14:20.000Z | src/reportlab/pdfbase/pdfdoc.py | radjkarl/reportlab | 48cafb6d64ff92fd9d4f9a4dd888be6f7d55b765 | [
"BSD-3-Clause"
] | 46 | 2015-03-28T10:18:14.000Z | 2021-12-16T15:57:47.000Z | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/pdfdoc.py
__version__=''' $Id$ '''
__doc__="""
The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that
all objects a... | 37.438589 | 178 | 0.594501 | __version__=''' $Id$ '''
__doc__="""
The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that
all objects are properly cross-referenced and indexed to the nearest byte. The
'inner structure' - the page descriptions - are presumed to be generated before
each page is saved.
pdfgen.py calls this... | true | true |
1c45ebcafc988d6417656fc2f57c14e952094419 | 591 | py | Python | kombu/asynchronous/http/__init__.py | kaiix/kombu | 580b5219cc50cad278c4b664d0e0f85e37a5e9ea | [
"BSD-3-Clause"
] | 1,920 | 2015-01-03T15:43:23.000Z | 2022-03-30T19:30:35.000Z | kombu/asynchronous/http/__init__.py | kaiix/kombu | 580b5219cc50cad278c4b664d0e0f85e37a5e9ea | [
"BSD-3-Clause"
] | 949 | 2015-01-02T18:56:00.000Z | 2022-03-31T23:14:59.000Z | kombu/asynchronous/http/__init__.py | kaiix/kombu | 580b5219cc50cad278c4b664d0e0f85e37a5e9ea | [
"BSD-3-Clause"
] | 833 | 2015-01-07T23:56:35.000Z | 2022-03-31T22:04:11.000Z | from kombu.asynchronous import get_event_loop
from .base import Headers, Request, Response
__all__ = ('Client', 'Headers', 'Response', 'Request')
def Client(hub=None, **kwargs):
"""Create new HTTP client."""
from .curl import CurlClient
return CurlClient(hub, **kwargs)
def get_client(hub=None, **kwarg... | 26.863636 | 68 | 0.685279 | from kombu.asynchronous import get_event_loop
from .base import Headers, Request, Response
__all__ = ('Client', 'Headers', 'Response', 'Request')
def Client(hub=None, **kwargs):
from .curl import CurlClient
return CurlClient(hub, **kwargs)
def get_client(hub=None, **kwargs):
hub = hub or get_event_loo... | true | true |
1c45ec2cae11560444aa0d63d936a8e946da8104 | 1,851 | py | Python | setup.py | lassejaco/pretix-eth-payment-plugin | be514a7387de8399cb11c9dd8971f286ccc9a72c | [
"Apache-2.0"
] | null | null | null | setup.py | lassejaco/pretix-eth-payment-plugin | be514a7387de8399cb11c9dd8971f286ccc9a72c | [
"Apache-2.0"
] | null | null | null | setup.py | lassejaco/pretix-eth-payment-plugin | be514a7387de8399cb11c9dd8971f286ccc9a72c | [
"Apache-2.0"
] | null | null | null | import os
from distutils.command.build import build # type: ignore
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding='utf-8') as f:
long_description = f.read()
class CustomBuild(build):
def run(self):
from django.core import manage... | 24.68 | 87 | 0.622907 | import os
from distutils.command.build import build
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding='utf-8') as f:
long_description = f.read()
class CustomBuild(build):
def run(self):
from django.core import management
ma... | true | true |
1c45ef8254822d3c204624c76142cdc54dcca2e2 | 457 | py | Python | dedomeno/houses/migrations/0098_auto_20170117_1650.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 38 | 2018-03-19T12:52:17.000Z | 2022-02-17T14:45:57.000Z | dedomeno/houses/migrations/0098_auto_20170117_1650.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 7 | 2020-02-11T23:01:40.000Z | 2020-08-06T13:30:58.000Z | dedomeno/houses/migrations/0098_auto_20170117_1650.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 12 | 2019-02-23T22:10:34.000Z | 2022-03-24T12:01:38.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-17 15:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('houses', '0097_property_online'),
]
operations = [
migrations.AlterField(
... | 21.761905 | 58 | 0.61488 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('houses', '0097_property_online'),
]
operations = [
migrations.AlterField(
model_name='realestate',
name='desc',
... | true | true |
1c45f025c99e2b8c21037589076efa5e71227813 | 17,668 | py | Python | graphsage/unsupervised_train.py | LiTszOn/GraphSAGE | dbeb50d52e8d242b3c4ad3e4264c168a2c406e70 | [
"MIT"
] | null | null | null | graphsage/unsupervised_train.py | LiTszOn/GraphSAGE | dbeb50d52e8d242b3c4ad3e4264c168a2c406e70 | [
"MIT"
] | null | null | null | graphsage/unsupervised_train.py | LiTszOn/GraphSAGE | dbeb50d52e8d242b3c4ad3e4264c168a2c406e70 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
import os
import time
import tensorflow as tf
import numpy as np
from graphsage.models import SampleAndAggregate, SAGEInfo, Node2VecModel
from graphsage.minibatch import EdgeMinibatchIterator
from graphsage.neigh_samplers import UniformNeighborSamp... | 45.302564 | 129 | 0.586258 | from __future__ import division
from __future__ import print_function
import os
import time
import tensorflow as tf
import numpy as np
from graphsage.models import SampleAndAggregate, SAGEInfo, Node2VecModel
from graphsage.minibatch import EdgeMinibatchIterator
from graphsage.neigh_samplers import UniformNeighborSamp... | true | true |
1c45f085e004e34a83549f22c405ac311d6001c4 | 48,492 | bzl | Python | examples/crate_universe/vendor_remote_pkgs/crates/defs.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | examples/crate_universe/vendor_remote_pkgs/crates/defs.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | examples/crate_universe/vendor_remote_pkgs/crates/defs.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# @generated
# This file is auto-generated by the cargo-bazel tool.
#
# DO NOT MODIFY: Local changes may be replaced in future executions.
###############################################################################
"""
# `crates_reposit... | 40.477462 | 552 | 0.644086 |
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
_COMMON_CONDITION = ""
def _flatten_dependency_maps(all_dependency_maps):
dependencies = {}
for workspace_deps_map in all_dep... | true | true |
1c45f11c3e11537796edf6b58ae0fb0bad91f88e | 10,785 | py | Python | code/scene.py | NoOneZero/coppelia | 14f589b361025506bf1dc2733edc5cf3ce27f45a | [
"Apache-2.0"
] | 1 | 2021-01-09T20:14:11.000Z | 2021-01-09T20:14:11.000Z | code/scene.py | NoOneZero/coppelia | 14f589b361025506bf1dc2733edc5cf3ce27f45a | [
"Apache-2.0"
] | null | null | null | code/scene.py | NoOneZero/coppelia | 14f589b361025506bf1dc2733edc5cf3ce27f45a | [
"Apache-2.0"
] | null | null | null | from code.character import Character
from code.spider import Spider
from code.neuro import Neuro
from code.excel import ExcelManager
from code.csv_manager import CscManager
import b0RemoteApi
import code.config as config
import time
from random import choices
import random
class Scene:
def __init__(self):
... | 41.964981 | 117 | 0.590357 | from code.character import Character
from code.spider import Spider
from code.neuro import Neuro
from code.excel import ExcelManager
from code.csv_manager import CscManager
import b0RemoteApi
import code.config as config
import time
from random import choices
import random
class Scene:
def __init__(self):
... | true | true |
1c45f2188bc7857583ffee040cd434578399dbd7 | 24,516 | py | Python | modules/webgrid2.py | dedebf/trilhas-poeticas-web2py-application | 61b28a60143a8bdce84a9fd8511f6b4504a34f33 | [
"MIT"
] | null | null | null | modules/webgrid2.py | dedebf/trilhas-poeticas-web2py-application | 61b28a60143a8bdce84a9fd8511f6b4504a34f33 | [
"MIT"
] | null | null | null | modules/webgrid2.py | dedebf/trilhas-poeticas-web2py-application | 61b28a60143a8bdce84a9fd8511f6b4504a34f33 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WebGrid for web2py
Developed by Nathan Freeze (Copyright � 2009)
Email <nathan@freezable.com>
License: GPL v2
This file contains code to build a table that supports
paging, sorting, editing and totals.
"""
##################-----WEBGRID2 CRIADO... | 45.653631 | 132 | 0.465206 |
from gluon.sql import Rows, Field, Set
from gluon.sqlhtml import *
from gluon.html import *
from gluon.storage import *
class Webgrid2(object):
def __init__(self, crud, name=None, datasource=None):
self.crud = crud
self.environment = crud.environment
self.name = name
self.c... | true | true |
1c45f5a3f7513812d906fa04e329c3a1e9236159 | 1,065 | py | Python | edmunds/foundation/concerns/serviceproviders.py | LowieHuyghe/edmunds-python | 236d087746cb8802a8854b2706b8d3ff009e9209 | [
"Apache-2.0"
] | 4 | 2017-09-07T13:39:50.000Z | 2018-05-31T16:14:50.000Z | edmunds/foundation/concerns/serviceproviders.py | LowieHuyghe/edmunds-python | 236d087746cb8802a8854b2706b8d3ff009e9209 | [
"Apache-2.0"
] | 103 | 2017-03-19T15:58:21.000Z | 2018-07-11T20:36:17.000Z | edmunds/foundation/concerns/serviceproviders.py | LowieHuyghe/edmunds-python | 236d087746cb8802a8854b2706b8d3ff009e9209 | [
"Apache-2.0"
] | 2 | 2017-10-14T15:20:11.000Z | 2018-04-20T09:55:44.000Z |
from threading import Lock
class ServiceProviders(object):
"""
This class concerns service providers code for Application to extend from
"""
def register(self, class_):
"""
Register a Service Provider
:param class_: The class of the provider
:type class_: ServicePr... | 28.783784 | 77 | 0.629108 |
from threading import Lock
class ServiceProviders(object):
def register(self, class_):
lock_key = 'edmunds.serviceprovider.lock'
providers_key = 'edmunds.serviceprovider.providers'
if lock_key not in self.extensions:
self.extensions[lock_key] = Lock()
... | true | true |
1c45f686a688b7c613282c5f90a0c54d646b4457 | 4,988 | py | Python | mmdet/distillation/distillers/csd_distiller.py | Senwang98/Lightweight-Detection-and-KD | 7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b | [
"Apache-2.0"
] | 8 | 2021-12-28T02:47:16.000Z | 2022-03-28T13:13:49.000Z | mmdet/distillation/distillers/csd_distiller.py | Senwang98/Lightweight-Detection-and-KD | 7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b | [
"Apache-2.0"
] | 1 | 2022-03-29T10:52:49.000Z | 2022-03-31T01:28:01.000Z | mmdet/distillation/distillers/csd_distiller.py | Senwang98/Lightweight-Detection-and-KD | 7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
import torch
from mmdet.models.detectors.base import BaseDetector
from mmdet.models import build_detector
from mmcv.runner import load_checkpoint, _load_checkpoint, load_state_dict
from ..builder import DISTILLER, build_distill_loss
from collections import OrderedDi... | 38.666667 | 104 | 0.621893 | import torch.nn as nn
import torch.nn.functional as F
import torch
from mmdet.models.detectors.base import BaseDetector
from mmdet.models import build_detector
from mmcv.runner import load_checkpoint, _load_checkpoint, load_state_dict
from ..builder import DISTILLER, build_distill_loss
from collections import OrderedDi... | true | true |
1c45f6fcf56f16cac02a648a17e1f72c3d8a6b99 | 270 | py | Python | tests/basics/bytearray_construct.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 37 | 2017-12-07T15:49:29.000Z | 2022-03-16T16:01:38.000Z | tests/basics/bytearray_construct.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 27 | 2015-01-02T16:17:37.000Z | 2015-09-07T19:21:26.000Z | tests/basics/bytearray_construct.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 22 | 2016-08-01T01:35:30.000Z | 2022-03-22T18:12:23.000Z | # test construction of bytearray from different objects
from array import array
# bytes, tuple, list
print(bytearray(b'123'))
print(bytearray((1, 2)))
print(bytearray([1, 2]))
# arrays
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))
| 20.769231 | 55 | 0.7 |
from array import array
print(bytearray(b'123'))
print(bytearray((1, 2)))
print(bytearray([1, 2]))
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))
| true | true |
1c45fb3f361b4037f9e9310bf53c677582ab3001 | 2,473 | py | Python | boto/pyami/startup.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | 1 | 2019-06-22T23:31:13.000Z | 2019-06-22T23:31:13.000Z | boto/pyami/startup.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | null | null | null | boto/pyami/startup.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | null | null | null | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | 40.540984 | 103 | 0.630004 | import sys
import boto
from boto.utils import find_class
from boto import config
from boto.pyami.scriptbase import ScriptBase
class Startup(ScriptBase):
def run_scripts(self):
scripts = config.get('Pyami', 'scripts')
if scripts:
for script in scripts.split(','):
script... | true | true |
1c45fb42c9cea7abcaef7ad6b5250326ab3d502e | 73,700 | py | Python | ambassador/tests/t_tls.py | jhsiaomei/ambassador | c2726366612e31b74c177329f51265b5ad0f8df7 | [
"Apache-2.0"
] | null | null | null | ambassador/tests/t_tls.py | jhsiaomei/ambassador | c2726366612e31b74c177329f51265b5ad0f8df7 | [
"Apache-2.0"
] | null | null | null | ambassador/tests/t_tls.py | jhsiaomei/ambassador | c2726366612e31b74c177329f51265b5ad0f8df7 | [
"Apache-2.0"
] | null | null | null | from kat.harness import Query
from abstract_tests import AmbassadorTest, HTTP, ServiceType
class TLSContextsTest(AmbassadorTest):
"""
This test makes sure that TLS is not turned on when it's not intended to. For example, when an 'upstream'
TLS configuration is passed, the port is not supposed to switch t... | 76.136364 | 2,291 | 0.859824 | from kat.harness import Query
from abstract_tests import AmbassadorTest, HTTP, ServiceType
class TLSContextsTest(AmbassadorTest):
def init(self):
self.target = HTTP()
def manifests(self) -> str:
return super().manifests() + """
---
apiVersion: v1
metadata:
name: test-tlscontexts-secret
... | true | true |
1c45fc1d3bc956ee5253c530f021440b4f006f32 | 45,154 | py | Python | hangups/ui/__main__.py | zetorian/hangups | 60715702fc23842a94c8d13e144a8bd0ce45654a | [
"MIT"
] | null | null | null | hangups/ui/__main__.py | zetorian/hangups | 60715702fc23842a94c8d13e144a8bd0ce45654a | [
"MIT"
] | null | null | null | hangups/ui/__main__.py | zetorian/hangups | 60715702fc23842a94c8d13e144a8bd0ce45654a | [
"MIT"
] | null | null | null | """Reference chat client for hangups."""
import appdirs
import asyncio
import configargparse
import contextlib
import logging
import os
import sys
import urwid
import readlike
import hangups
from hangups.ui.emoticon import replace_emoticons
from hangups.ui import notifier
from hangups.ui.utils import get_conv_name, a... | 39.094372 | 79 | 0.607477 |
import appdirs
import asyncio
import configargparse
import contextlib
import logging
import os
import sys
import urwid
import readlike
import hangups
from hangups.ui.emoticon import replace_emoticons
from hangups.ui import notifier
from hangups.ui.utils import get_conv_name, add_color_to_scheme
if urwid.__version__... | true | true |
1c45fd021187544fbd3336d5d553e7bcdc31d6de | 2,477 | py | Python | ANPR.py | itcthienkhiem/myANPR | e0a76b2165d539c6a38f51f7485f37349a85a074 | [
"Apache-2.0"
] | null | null | null | ANPR.py | itcthienkhiem/myANPR | e0a76b2165d539c6a38f51f7485f37349a85a074 | [
"Apache-2.0"
] | null | null | null | ANPR.py | itcthienkhiem/myANPR | e0a76b2165d539c6a38f51f7485f37349a85a074 | [
"Apache-2.0"
] | null | null | null |
try:
import cv2
except ImportError:
print ("You must have OpenCV installed")
import matplotlib.pyplot as plt
import numpy as np
#Image(filename='../../../data/ANPR/sample_plates.png')
def showfig(image, ucmap):
#There is a difference in pixel ordering in OpenCV and Matplotlib.
#OpenCV fol... | 31.75641 | 88 | 0.669762 |
try:
import cv2
except ImportError:
print ("You must have OpenCV installed")
import matplotlib.pyplot as plt
import numpy as np
def showfig(image, ucmap):
if len(image.shape)==3 :
b,g,r = cv2.split(image) image = cv2.merge([r,g,b]) imgplot=plt.imshow(image... | true | true |
1c45fe0df1db49b180b71b556b709af501dbc80c | 86 | py | Python | tests/profiling/wrong_program_gevent.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/profiling/wrong_program_gevent.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-01-27T04:53:24.000Z | 2021-01-27T04:53:24.000Z | tests/profiling/wrong_program_gevent.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from gevent import monkey
import ddtrace.profiling.auto # noqa
monkey.patch_all()
| 12.285714 | 37 | 0.77907 | from gevent import monkey
import ddtrace.profiling.auto
monkey.patch_all()
| true | true |
1c45fe43ea64a09d9242eb97f7af409854244804 | 10,694 | py | Python | readers.py | ankitshah009/youtube-8m-1 | a0f28c9ca05b72ca709322f2c4871a4345a69fbb | [
"Apache-2.0"
] | 2 | 2018-09-15T04:14:28.000Z | 2019-02-14T02:35:55.000Z | readers.py | ankitshah009/youtube-8m-1 | a0f28c9ca05b72ca709322f2c4871a4345a69fbb | [
"Apache-2.0"
] | null | null | null | readers.py | ankitshah009/youtube-8m-1 | a0f28c9ca05b72ca709322f2c4871a4345a69fbb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 37.921986 | 101 | 0.696559 |
import tensorflow as tf
try:
from . import utils
except ImportError:
import utils
from tensorflow import logging
def resize_axis(tensor, axis, new_size, fill_value=0):
tensor = tf.convert_to_tensor(tensor)
shape = tf.unstack(tf.shape(tensor))
pad_shape = shape[:]
pad_shape[axis] = tf.maximu... | true | true |
1c45ffd929e7bc233ccb8e5fdcdba952ce40321b | 6,303 | py | Python | userbot/plugins/updater.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | userbot/plugins/updater.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | userbot/plugins/updater.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | """Update UserBot code (for Xtra-Telegram)
Syntax: .update
\nAll Credits goes to © @Three_Cube_TeKnoways
\nFor this awasome plugin.\nPorted from PpaperPlane Extended"""
from os import remove, execle, path, makedirs, getenv, environ,execl
from shutil import rmtree
import asyncio
import sys
from git import Repo
from git... | 38.2 | 136 | 0.618912 |
from os import remove, execle, path, makedirs, getenv, environ,execl
from shutil import rmtree
import asyncio
import sys
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from userbot import CMD_HELP, bot
from userbot.utils import admin_cmd
UPSTREAM_REPO_URL = "https... | true | true |
1c460171229eb1de0dd2daccc2cae4a857668e41 | 6,051 | py | Python | util.py | bbitarello/ldpred | b84b99f23dc83dc164300b8dee6678207461a751 | [
"MIT"
] | 89 | 2016-06-03T14:31:21.000Z | 2022-02-22T02:15:45.000Z | util.py | bbitarello/ldpred | b84b99f23dc83dc164300b8dee6678207461a751 | [
"MIT"
] | 143 | 2016-08-10T14:06:53.000Z | 2021-07-04T10:29:26.000Z | util.py | bbitarello/ldpred | b84b99f23dc83dc164300b8dee6678207461a751 | [
"MIT"
] | 68 | 2016-08-05T14:56:39.000Z | 2021-12-10T15:43:35.000Z | """
Various general utility functions.
"""
import scipy as sp
from scipy import stats
import pickle
import gzip
import os
from itertools import takewhile
from itertools import repeat
import sys
import re
# LDpred currently ignores the Y and MT chromosomes.
ok_chromosomes = set(range(1, 24))
chromosomes_list = ['chrom... | 27.013393 | 139 | 0.605354 | import scipy as sp
from scipy import stats
import pickle
import gzip
import os
from itertools import takewhile
from itertools import repeat
import sys
import re
ok_chromosomes = set(range(1, 24))
chromosomes_list = ['chrom_%d' % (chrom) for chrom in ok_chromosomes]
chrom_name_map = {'X':23,'chr_X':23,'chrom_X':23}
fo... | true | true |
1c4601d6ca6b386fcd89245ffea8fedcc89875c1 | 2,924 | py | Python | test/functional/mempool_resurrect.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | 1 | 2019-05-27T11:12:53.000Z | 2019-05-27T11:12:53.000Z | test/functional/mempool_resurrect.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | null | null | null | test/functional/mempool_resurrect.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the blockchain is re-organized."""
from test_framewor... | 41.183099 | 123 | 0.675103 |
from test_framework.blocktools import create_raw_transaction
from test_framework.test_framework import MachinecoinTestFramework
from test_framework.util import assert_equal
class MempoolCoinbaseTest(MachinecoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def skip_test_if_missing_mod... | true | true |
1c4602bc2b8f35a6487314afa0547956c601bf34 | 3,032 | py | Python | estatisticas_facebook/users/migrations/0001_initial.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 2 | 2017-12-22T01:00:22.000Z | 2017-12-22T11:14:40.000Z | estatisticas_facebook/users/migrations/0001_initial.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 18 | 2017-12-14T12:04:45.000Z | 2022-03-11T23:23:05.000Z | estatisticas_facebook/users/migrations/0001_initial.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 1 | 2021-03-27T16:18:56.000Z | 2021-03-27T16:18:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-06 11:33
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 63.166667 | 329 | 0.662929 | from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_length'... | true | true |
1c460421d2d07bef9ca1d09f5ba7710449101a3e | 689 | py | Python | battleships/managers/GameOver.py | wkta/Python-Bataille-Navale | b6f725519cf1cf559e60ec766aa4f059463b1493 | [
"MIT"
] | null | null | null | battleships/managers/GameOver.py | wkta/Python-Bataille-Navale | b6f725519cf1cf559e60ec766aa4f059463b1493 | [
"MIT"
] | null | null | null | battleships/managers/GameOver.py | wkta/Python-Bataille-Navale | b6f725519cf1cf559e60ec766aa4f059463b1493 | [
"MIT"
] | 1 | 2019-12-03T15:42:38.000Z | 2019-12-03T15:42:38.000Z | # Copyright © 2019 CAILLAUD Jean-Baptiste.
# import the engine.
import engine
class GameOver(engine.LevelManager):
"""
Renders the game over screen.
"""
def begin(self):
# Add the close handler.
engine.Engine.input_handler.add_listener(engine.CloseOnEscapeOrQuit())
# Create... | 26.5 | 86 | 0.596517 |
import engine
class GameOver(engine.LevelManager):
def begin(self):
engine.Engine.input_handler.add_listener(engine.CloseOnEscapeOrQuit())
text = engine.TextGameObject(
engine.Engine.scene,
"Futura",
48,
"You won !" if engine.Engin... | true | true |
1c460473d11c959ddd81ee921f32596dbd8e1e9e | 754 | py | Python | snakewatch/action/__init__.py | asoc/snakewatch | 347b94e0ca59cdb309a6950fa3b5464c8d0081f8 | [
"BSD-3-Clause"
] | null | null | null | snakewatch/action/__init__.py | asoc/snakewatch | 347b94e0ca59cdb309a6950fa3b5464c8d0081f8 | [
"BSD-3-Clause"
] | null | null | null | snakewatch/action/__init__.py | asoc/snakewatch | 347b94e0ca59cdb309a6950fa3b5464c8d0081f8 | [
"BSD-3-Clause"
] | null | null | null | """
This file is part of snakewatch.
snakewatch is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snakewatch is distributed in the hop... | 37.7 | 82 | 0.795756 |
from __future__ import print_function, absolute_import, unicode_literals, division
| true | true |
1c4604bd0cd7e6cda5fbccf019cd6209998f11b6 | 2,134 | py | Python | tests/unit/pypyr/parser/jsonfile_test.py | pypyr/pypyr-cli | dc0f694ac0c0e3c2844c1a20788c9af586a8a16e | [
"Apache-2.0"
] | 31 | 2017-03-24T11:27:34.000Z | 2020-05-27T20:06:28.000Z | tests/unit/pypyr/parser/jsonfile_test.py | pypyr/pypyr-cli | dc0f694ac0c0e3c2844c1a20788c9af586a8a16e | [
"Apache-2.0"
] | 89 | 2017-04-12T09:50:32.000Z | 2020-08-13T13:18:36.000Z | tests/unit/pypyr/parser/jsonfile_test.py | pypyr/pypyr-cli | dc0f694ac0c0e3c2844c1a20788c9af586a8a16e | [
"Apache-2.0"
] | 6 | 2017-06-04T14:19:59.000Z | 2020-02-10T13:16:40.000Z | """jsonfile.py unit tests."""
from unittest.mock import patch
import pytest
import pypyr.parser.jsonfile
def test_json_file_open_fails_on_arbitrary_string():
"""Non path-y input string should fail."""
with pytest.raises(FileNotFoundError):
pypyr.parser.jsonfile.get_parsed_context('value 1,value 2, v... | 31.850746 | 75 | 0.679944 | from unittest.mock import patch
import pytest
import pypyr.parser.jsonfile
def test_json_file_open_fails_on_arbitrary_string():
with pytest.raises(FileNotFoundError):
pypyr.parser.jsonfile.get_parsed_context('value 1,value 2, value3')
def test_json_file_open_fails_on_empty_string():
with pytest.ra... | true | true |
1c46065a2d7cec80d32a5396991fd1b74b074e66 | 8,727 | py | Python | syncflux.py | nagylzs/syncflux | c070267065cad817708d0680e17bfe5f8942310f | [
"Apache-2.0"
] | null | null | null | syncflux.py | nagylzs/syncflux | c070267065cad817708d0680e17bfe5f8942310f | [
"Apache-2.0"
] | null | null | null | syncflux.py | nagylzs/syncflux | c070267065cad817708d0680e17bfe5f8942310f | [
"Apache-2.0"
] | null | null | null | import copy
import datetime
import sys
import os
import time
import argparse
import traceback
import pytz
import syncthing
from influxdb import InfluxDBClient
import yaml
from yaml2dataclass import Schema, SchemaPath
from typing import Optional, Dict, Type, List
from dataclasses import dataclass, asdict, field
@dat... | 33.694981 | 119 | 0.605936 | import copy
import datetime
import sys
import os
import time
import argparse
import traceback
import pytz
import syncthing
from influxdb import InfluxDBClient
import yaml
from yaml2dataclass import Schema, SchemaPath
from typing import Optional, Dict, Type, List
from dataclasses import dataclass, asdict, field
@dat... | true | true |
1c46086c638aabe3f56e864c3f814d7d84d20949 | 9,687 | py | Python | lib/spack/spack/build_systems/cuda.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/build_systems/cuda.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2022-02-28T11:32:57.000Z | 2022-03-02T11:37:37.000Z | lib/spack/spack/build_systems/cuda.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.variant
from spack.directives import conflicts, depends_on, variant
from spack.multimethod import when
from s... | 50.19171 | 92 | 0.617425 |
import spack.variant
from spack.directives import conflicts, depends_on, variant
from spack.multimethod import when
from spack.package import PackageBase
class CudaPackage(PackageBase):
cuda_arch_values = (
'10', '11', '12', '13',
'20', '21',
'30', '32', '35', '37',
'... | true | true |
1c460873137198c0c9f2771d470c8e55b0d5da3b | 33 | py | Python | step2.py | SirLonsevrot/Lesson_20.11.28 | eac91b46441bf641c60d7f5d1340d74f8665614b | [
"Apache-2.0"
] | null | null | null | step2.py | SirLonsevrot/Lesson_20.11.28 | eac91b46441bf641c60d7f5d1340d74f8665614b | [
"Apache-2.0"
] | null | null | null | step2.py | SirLonsevrot/Lesson_20.11.28 | eac91b46441bf641c60d7f5d1340d74f8665614b | [
"Apache-2.0"
] | null | null | null | print('Георгий ничего не умеет')
| 16.5 | 32 | 0.757576 | print('Георгий ничего не умеет')
| true | true |
1c4608abdf6f6b3a4ea765ffc6252d1d214de3d1 | 6,003 | py | Python | pro/views.py | iyerikuzwe/Award | a5ac352a7d05d23c92167022e00648caeab62590 | [
"Unlicense"
] | null | null | null | pro/views.py | iyerikuzwe/Award | a5ac352a7d05d23c92167022e00648caeab62590 | [
"Unlicense"
] | null | null | null | pro/views.py | iyerikuzwe/Award | a5ac352a7d05d23c92167022e00648caeab62590 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from .forms import ProjectForm, ProfileForm, DesignForm, ContentForm, UsabilityForm
from .models import Project, Profile
from django.contrib.auth.models import... | 33.35 | 91 | 0.666167 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from .forms import ProjectForm, ProfileForm, DesignForm, ContentForm, UsabilityForm
from .models import Project, Profile
from django.contrib.auth.models import... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.