max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
compiler-rt/unittests/lit_unittest_cfg_utils.py | medismailben/llvm-project | 2,338 | 6628751 | <filename>compiler-rt/unittests/lit_unittest_cfg_utils.py<gh_stars>1000+
# Put all 64-bit tests in the shadow-memory parallelism group. We throttle those
# in our common lit config (lit.common.unit.cfg.py).
def darwin_sanitizer_parallelism_group_func(test):
return "shadow-memory" if "x86_64" in test.file_path else No... | <filename>compiler-rt/unittests/lit_unittest_cfg_utils.py<gh_stars>1000+
# Put all 64-bit tests in the shadow-memory parallelism group. We throttle those
# in our common lit config (lit.common.unit.cfg.py).
def darwin_sanitizer_parallelism_group_func(test):
return "shadow-memory" if "x86_64" in test.file_path else No... | en | 0.704809 | # Put all 64-bit tests in the shadow-memory parallelism group. We throttle those # in our common lit config (lit.common.unit.cfg.py). | 1.635064 | 2 |
employee/views.py | AnnabelNkir/MVC-CrudCapability | 0 | 6628752 | <gh_stars>0
from django.shortcuts import render,redirect
import employee
from .models import Employee
from .forms import *
from .forms import EmployeeForm
def employees_list(request):
employees = Employee.objects.order_by('-id')
context = {
'employees': employees,
}
return render(request, 'lis... | from django.shortcuts import render,redirect
import employee
from .models import Employee
from .forms import *
from .forms import EmployeeForm
def employees_list(request):
employees = Employee.objects.order_by('-id')
context = {
'employees': employees,
}
return render(request, 'list.html', con... | none | 1 | 2.218359 | 2 | |
HackerRank/number_strings.py | Haroldgm/Python | 0 | 6628753 | # https://www.hackerrank.com/challenges/python-print/problem
# The included code stub will read an integer, , from STDIN.
# Without using any string methods, try to print the following:
# Note that "" represents the consecutive values in between.
# Example n = 5
#Print the string 12345
if __name__ == '__main__':
... | # https://www.hackerrank.com/challenges/python-print/problem
# The included code stub will read an integer, , from STDIN.
# Without using any string methods, try to print the following:
# Note that "" represents the consecutive values in between.
# Example n = 5
#Print the string 12345
if __name__ == '__main__':
... | en | 0.834123 | # https://www.hackerrank.com/challenges/python-print/problem # The included code stub will read an integer, , from STDIN. # Without using any string methods, try to print the following: # Note that "" represents the consecutive values in between. # Example n = 5 #Print the string 12345 | 4.065676 | 4 |
src/neon/testing/__init__.py | MUTTERSCHIFF/ngraph-neon | 13 | 6628754 | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... | en | 0.727908 | # ****************************************************************************** # Copyright 2017-2018 Intel Corporation # # 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.apa... | 1.787065 | 2 |
apps/opsdocs/apps.py | ykyk1229/TurtleDove | 1 | 6628755 | <gh_stars>1-10
from django.apps import AppConfig
class OpsdocsConfig(AppConfig):
name = 'opsdocs'
| from django.apps import AppConfig
class OpsdocsConfig(AppConfig):
name = 'opsdocs' | none | 1 | 1.028528 | 1 | |
Python/Discord/olds/serverPrefix.py | programmer-666/Codes | 0 | 6628756 | # actual checks
import discord
from discord.ext import commands, tasks
cl = commands.Bot(command_prefix='%')
@cl.event
async def on_ready():
print('ready')
cl.run('<KEY>')
| # actual checks
import discord
from discord.ext import commands, tasks
cl = commands.Bot(command_prefix='%')
@cl.event
async def on_ready():
print('ready')
cl.run('<KEY>')
| es | 0.934346 | # actual checks | 2.317033 | 2 |
saleor/graphql/order/filters.py | Iahack/saleor | 9 | 6628757 | from django.db.models import Q
from django_filters import CharFilter, NumberFilter
from graphene_django.filter.filterset import GlobalIDMultipleChoiceFilter
from ...order import models
from ..core.filters import DistinctFilterSet
class OrderFilter(DistinctFilterSet):
"""Filter class for order query.
Field i... | from django.db.models import Q
from django_filters import CharFilter, NumberFilter
from graphene_django.filter.filterset import GlobalIDMultipleChoiceFilter
from ...order import models
from ..core.filters import DistinctFilterSet
class OrderFilter(DistinctFilterSet):
"""Filter class for order query.
Field i... | en | 0.822852 | Filter class for order query. Field id is a GraphQL type ID, while order_id represents database primary key. | 2.15558 | 2 |
core/python/kungfu/command/account/edit.py | lf-shaw/kungfu | 2,209 | 6628758 | import click
from kungfu.command.account import account, pass_ctx_from_parent, make_questions, encrypt
from PyInquirer import prompt
@account.command()
@click.option('--receive_md', is_flag=True, help='receive market data with this account')
@click.option('-i', '--id', type=str, required=True, help='id')
@click.pass_... | import click
from kungfu.command.account import account, pass_ctx_from_parent, make_questions, encrypt
from PyInquirer import prompt
@account.command()
@click.option('--receive_md', is_flag=True, help='receive market data with this account')
@click.option('-i', '--id', type=str, required=True, help='id')
@click.pass_... | none | 1 | 2.510924 | 3 | |
Leetcode/Best_Time_to_Buy_and_Sell_Stock_II.py | jiangtianyu2009/bop | 1 | 6628759 | class Solution:
def maxProfit(self, prices: List[int]) -> int:
sum = 0
p = 1
while p < len(prices):
if prices[p] > prices[p - 1]:
sum = sum + prices[p] - prices[p - 1]
p = p + 1
return sum
| class Solution:
def maxProfit(self, prices: List[int]) -> int:
sum = 0
p = 1
while p < len(prices):
if prices[p] > prices[p - 1]:
sum = sum + prices[p] - prices[p - 1]
p = p + 1
return sum
| none | 1 | 2.841203 | 3 | |
src/legacy/python/legacy_gui/rlbot_legacy_gui/preset_editors.py | VirxEC/RLBot | 408 | 6628760 | import os
import json
from PyQt5 import QtWidgets, QtCore
import configparser
import pathlib
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QListWidgetItem
from rlbot_legacy_gui.design.car_customisation import Ui_LoadoutPresetCustomiser
from rlbot_legacy_gui.design.agent_customisation import Ui_AgentPresetCu... | import os
import json
from PyQt5 import QtWidgets, QtCore
import configparser
import pathlib
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QListWidgetItem
from rlbot_legacy_gui.design.car_customisation import Ui_LoadoutPresetCustomiser
from rlbot_legacy_gui.design.agent_customisation import Ui_AgentPresetCu... | en | 0.722088 | The Base of the popup windows to modify a Preset, handles the basic method of editing the preset # Also updates the combobox which you can select the agent preset for the bot through # Remove this preset from the dict since it is not currently keyed by config path # Add it back keyed by config path The class extending ... | 2.241856 | 2 |
superset/views/datasource/schemas.py | razzius/superset | 18,621 | 6628761 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | en | 0.852985 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 1.892687 | 2 |
django-rgd-geometry/tests/test_project/urls.py | ResonantGeoData/ResonantGeoData | 40 | 6628762 | <reponame>ResonantGeoData/ResonantGeoData<gh_stars>10-100
from django.urls import include, path
urlpatterns = [
# Make this distinct from typical production values, to ensure it works dynamically
path('rgd_test/', include('rgd.urls')),
path('rgd_geometry_test/', include('rgd_geometry.urls')),
]
| from django.urls import include, path
urlpatterns = [
# Make this distinct from typical production values, to ensure it works dynamically
path('rgd_test/', include('rgd.urls')),
path('rgd_geometry_test/', include('rgd_geometry.urls')),
] | en | 0.868473 | # Make this distinct from typical production values, to ensure it works dynamically | 1.503417 | 2 |
nexus/meta_api/proto/search_service_pb2.py | RobbiNespu/hyperboria | 54 | 6628763 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nexus/meta_api/proto/search_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nexus/meta_api/proto/search_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | en | 0.255381 | # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: nexus/meta_api/proto/search_service.proto Generated protocol buffer code. # @@protoc_insertion_point(imports) #.nexus.meta_api.proto.SearchRequest\x1a$.nexus.meta_api.proto.SearchResponse\"\x00\x62\x06proto3' # @@protoc_inserti... | 1.023087 | 1 |
The dawn of Otrozhny/gameIO.py | SeoFernando25/The-dawn-of-Otrozhny | 0 | 6628764 | <gh_stars>0
# Used this for serialization
# and deserialization of files in the game
import pickle
import levelData
import entities
import os
from functools import lru_cache
import pygame
PATH_ROOT = os.getcwd()
MAPS_PATH = os.path.join(PATH_ROOT, "Maps")
def list_maps():
map_names = []
if not os... | # Used this for serialization
# and deserialization of files in the game
import pickle
import levelData
import entities
import os
from functools import lru_cache
import pygame
PATH_ROOT = os.getcwd()
MAPS_PATH = os.path.join(PATH_ROOT, "Maps")
def list_maps():
map_names = []
if not os.path.exists... | en | 0.717045 | # Used this for serialization # and deserialization of files in the game #[-4] to remove extension and just get the map name # The lru cache caches the results of the function # so I dont need to create a new surface object # everytime | 2.84148 | 3 |
src/sources/url_manager.py | joshuaellinger/corona19-data-pipeline | 17 | 6628765 | <gh_stars>10-100
#
# UrlManager
#
# make sure we don't hit the same URL twice
#
from typing import Tuple
from loguru import logger
import time
from shared.util import fetch_with_requests
from capture.captive_browser import CaptiveBrowser
class UrlManager:
def __init__(self, headless=True, browser="requests"):... | #
# UrlManager
#
# make sure we don't hit the same URL twice
#
from typing import Tuple
from loguru import logger
import time
from shared.util import fetch_with_requests
from capture.captive_browser import CaptiveBrowser
class UrlManager:
def __init__(self, headless=True, browser="requests"):
self.his... | en | 0.905276 | # # UrlManager # # make sure we don't hit the same URL twice # | 2.476546 | 2 |
boltons/iterutils.py | jpoehnelt/boltons | 0 | 6628766 | <reponame>jpoehnelt/boltons<gh_stars>0
# -*- coding: utf-8 -*-
""":mod:`itertools` is full of great examples of Python generator
usage. However, there are still some critical gaps. ``iterutils``
fills many of those gaps with featureful, tested, and Pythonic
solutions.
Many of the functions below have two versions, one... | # -*- coding: utf-8 -*-
""":mod:`itertools` is full of great examples of Python generator
usage. However, there are still some critical gaps. ``iterutils``
fills many of those gaps with featureful, tested, and Pythonic
solutions.
Many of the functions below have two versions, one which
returns an iterator (denoted by ... | en | 0.733082 | # -*- coding: utf-8 -*- :mod:`itertools` is full of great examples of Python generator usage. However, there are still some critical gaps. ``iterutils`` fills many of those gaps with featureful, tested, and Pythonic solutions. Many of the functions below have two versions, one which returns an iterator (denoted by the... | 2.957244 | 3 |
mwe.py | lenoch/tagsetbench | 0 | 6628767 | # from copy import deepcopy
import re
from symbols import Token
ORDINAL_NUMBER = re.compile('(\d+)\.')
# TODO: tohle nepoužívám (snad ani v testech), tak nějak rozsekat (využít
# v modification.handle_mwes) a pohřbít
def handle_mwes(tokens, args):
"""
NOTE: většinu MWE mám v úsporné formě, takže by de... | # from copy import deepcopy
import re
from symbols import Token
ORDINAL_NUMBER = re.compile('(\d+)\.')
# TODO: tohle nepoužívám (snad ani v testech), tak nějak rozsekat (využít
# v modification.handle_mwes) a pohřbít
def handle_mwes(tokens, args):
"""
NOTE: většinu MWE mám v úsporné formě, takže by de... | cs | 0.963889 | # from copy import deepcopy # TODO: tohle nepoužívám (snad ani v testech), tak nějak rozsekat (využít # v modification.handle_mwes) a pohřbít NOTE: většinu MWE mám v úsporné formě, takže by default se nechají být TODO: rozšiřovat se budou jenom vybraný druhy MWE, např. řadový číslovky, čísla s mezer... | 2.818866 | 3 |
source/environment/atari/episodic_life.py | Aethiles/ppo-pytorch | 0 | 6628768 | import gym
import numpy as np
from typing import Dict, Tuple
class EpisodicLifeEnv(gym.Wrapper):
def __init__(self,
env: gym.Wrapper,
):
"""
Signals end of episode on loss of life to improve value estimation.
Slightly modified from OpenAI baselines AtariW... | import gym
import numpy as np
from typing import Dict, Tuple
class EpisodicLifeEnv(gym.Wrapper):
def __init__(self,
env: gym.Wrapper,
):
"""
Signals end of episode on loss of life to improve value estimation.
Slightly modified from OpenAI baselines AtariW... | en | 0.742494 | Signals end of episode on loss of life to improve value estimation. Slightly modified from OpenAI baselines AtariWrappers. As detailed in Mnih et al. (2015) -- aka Nature paper. :param env: the inner environment Resets the environment :param kwargs: :return: Performs the provided action ... | 3.200706 | 3 |
augmentation/cam_augmentation.py | hwfan/STRAPS-3DHumanShapePose | 1 | 6628769 | <filename>augmentation/cam_augmentation.py
import torch
def augment_cam_t(mean_cam_t, xy_std=0.05, delta_z_range=[-5, 5]):
batch_size = mean_cam_t.shape[0]
device = mean_cam_t.device
new_cam_t = mean_cam_t.clone()
delta_tx_ty = torch.randn(batch_size, 2, device=device) * xy_std
new_cam_t[:, :2] = ... | <filename>augmentation/cam_augmentation.py
import torch
def augment_cam_t(mean_cam_t, xy_std=0.05, delta_z_range=[-5, 5]):
batch_size = mean_cam_t.shape[0]
device = mean_cam_t.device
new_cam_t = mean_cam_t.clone()
delta_tx_ty = torch.randn(batch_size, 2, device=device) * xy_std
new_cam_t[:, :2] = ... | none | 1 | 2.554411 | 3 | |
nicos_mlz/mira/setups/sample_ext.py | ebadkamil/nicos | 0 | 6628770 | <gh_stars>0
description = 'sample table (external control)'
group = 'lowlevel'
tango_base = 'tango://miractrl.mira.frm2:10000/mira/'
devices = dict(
co_stt = device('nicos.devices.tango.Sensor',
lowlevel = True,
tangodevice = tango_base + 'sample/phi_ext_enc',
unit = 'deg',
),
mo_s... | description = 'sample table (external control)'
group = 'lowlevel'
tango_base = 'tango://miractrl.mira.frm2:10000/mira/'
devices = dict(
co_stt = device('nicos.devices.tango.Sensor',
lowlevel = True,
tangodevice = tango_base + 'sample/phi_ext_enc',
unit = 'deg',
),
mo_stt = device(... | none | 1 | 1.427445 | 1 | |
src/facial_landmarks_detection.py | princeamitlali/computer-pointer-controller | 0 | 6628771 | <gh_stars>0
import cv2
import numpy as np
import logging as log
from openvino.inference_engine import IENetwork, IECore
import warnings
warnings.filterwarnings("ignore")
class FacialLandmarksClass:
def __init__(self, model_name, device, extensions=None):
self.model_weights = model_name + '.bin'
... | import cv2
import numpy as np
import logging as log
from openvino.inference_engine import IENetwork, IECore
import warnings
warnings.filterwarnings("ignore")
class FacialLandmarksClass:
def __init__(self, model_name, device, extensions=None):
self.model_weights = model_name + '.bin'
self.model_s... | none | 1 | 2.227956 | 2 | |
openpype/hosts/photoshop/plugins/publish/validate_naming.py | 2-REC-forks/OpenPype | 1 | 6628772 | <gh_stars>1-10
import re
import pyblish.api
import openpype.api
from avalon import photoshop
class ValidateNamingRepair(pyblish.api.Action):
"""Repair the instance asset."""
label = "Repair"
icon = "wrench"
on = "failed"
def process(self, context, plugin):
# Get the errored instances
... | import re
import pyblish.api
import openpype.api
from avalon import photoshop
class ValidateNamingRepair(pyblish.api.Action):
"""Repair the instance asset."""
label = "Repair"
icon = "wrench"
on = "failed"
def process(self, context, plugin):
# Get the errored instances
failed =... | en | 0.792429 | Repair the instance asset. # Get the errored instances # Apply pyblish.logic to get the instances for the plug-in Validate the instance name. Spaces in names are not allowed. Will be replace with underscores. # configured by Settings Pass values configured in Settings for Repair. | 2.380908 | 2 |
venv/lib/python2.7/site-packages/jsonh/__init__.py | Gabik077/domo_home | 1 | 6628773 | <reponame>Gabik077/domo_home<filename>venv/lib/python2.7/site-packages/jsonh/__init__.py
from .jsonh import load, loads, dump, dumps, pack, unpack, compress, uncompress
| from .jsonh import load, loads, dump, dumps, pack, unpack, compress, uncompress | none | 1 | 1.092001 | 1 | |
tests/test_visitors/test_ast/test_complexity/test_counts/test_try_body_length.py | Andrka/wemake-python-styleguide | 1 | 6628774 | <gh_stars>1-10
import pytest
from wemake_python_styleguide.violations.complexity import (
TooLongTryBodyViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
TryExceptVisitor,
)
try_without_except = """
try:
{0}
finally:
...
"""
simple_try_except = """
try:
{0}
except... | import pytest
from wemake_python_styleguide.violations.complexity import (
TooLongTryBodyViolation,
)
from wemake_python_styleguide.visitors.ast.complexity.counts import (
TryExceptVisitor,
)
try_without_except = """
try:
{0}
finally:
...
"""
simple_try_except = """
try:
{0}
except ValueError:
... | en | 0.647767 | try: {0} finally: ... try: {0} except ValueError: ... try: {0} except ValueError: ... else: ... try: {0} except ValueError: ... else: ... finally: ... # Wrong: try: ... finally: {0} try: ... except ValueError: {0} try: ... except ValueError: ... else: ... | 2.465746 | 2 |
hops/distribute/allreduce.py | tkakantousis/hops-util-py | 0 | 6628775 | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import os
from hops import hdfs as hopshdfs
from hops import tensorboard
from hops import devi... | """
Utility functions to retrieve information about available services and setting up security for the Hops platform.
These utils facilitates development by hiding complexity for programs interacting with Hops services.
"""
import os
from hops import hdfs as hopshdfs
from hops import tensorboard
from hops import devi... | en | 0.752987 | Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. Args: sc: map_fun: local_logdir: name: Returns: #Each TF task shou... | 2.482635 | 2 |
aws_s3_resource/s3_bucket.py | Quakingaspen-codehub/aws_s3_resource | 0 | 6628776 | from . import S3
from .s3_object import S3Object
from botocore.client import ClientError
import uuid
import os
import boto3
class S3Bucket(S3):
@staticmethod
def create_name(bucket_prefix, num_random_chars=6):
if num_random_chars < NumberRandomCharsException.min_num_chars or \... | from . import S3
from .s3_object import S3Object
from botocore.client import ClientError
import uuid
import os
import boto3
class S3Bucket(S3):
@staticmethod
def create_name(bucket_prefix, num_random_chars=6):
if num_random_chars < NumberRandomCharsException.min_num_chars or \... | en | 0.880816 | # Take the region from the config file # Create the bucket # Create the root folder # A set contains all created folders # Folder or file path # If the object name end with special character "/", it will definitely be a folder # Continue if folder already created # Create the folder tree and add it to the created set #... | 2.465923 | 2 |
homeassistant/components/smart_meter_texas/__init__.py | basicpail/core | 5 | 6628777 | """The Smart Meter Texas integration."""
import asyncio
import logging
import ssl
from smart_meter_texas import Account, Client, ClientSSLContext
from smart_meter_texas.exceptions import (
SmartMeterTexasAPIError,
SmartMeterTexasAuthError,
)
from homeassistant.config_entries import ConfigEntry
from homeassist... | """The Smart Meter Texas integration."""
import asyncio
import logging
import ssl
from smart_meter_texas import Account, Client, ClientSSLContext
from smart_meter_texas.exceptions import (
SmartMeterTexasAPIError,
SmartMeterTexasAuthError,
)
from homeassistant.config_entries import ConfigEntry
from homeassist... | en | 0.779988 | The Smart Meter Texas integration. Set up Smart Meter Texas from a config entry. # Use a DataUpdateCoordinator to manage the updates. This is due to the # Smart Meter Texas API which takes around 30 seconds to read a meter. # This avoids Home Assistant from complaining about the component taking # too long to update. M... | 2.221124 | 2 |
train.py | sriyash421/HEP-AnomalyDetection | 0 | 6628778 | <filename>train.py<gh_stars>0
import os
import torch
import pandas as pd
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from torch.utils.data import random_split
from models import Classifier, AutoEncoder
import numpy as np
from utils import print_dict, get_distance_matrix
import tqdm
from sklea... | <filename>train.py<gh_stars>0
import os
import torch
import pandas as pd
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from torch.utils.data import random_split
from models import Classifier, AutoEncoder
import numpy as np
from utils import print_dict, get_distance_matrix
import tqdm
from sklea... | en | 0.949678 | create a training class get output create optimizer and scheduler executed during training executed during validation # plotting ROC curve | 2.327782 | 2 |
Evaluation/Plot_pvalueOverTime.py | Lucciola111/stream_autoencoder_windowing | 4 | 6628779 | <filename>Evaluation/Plot_pvalueOverTime.py
import matplotlib.pyplot as plt
import seaborn as sns
def plot_pvalue_over_time(df_p_value, value="p-value", max_ylim=False, log=True, plot_file_name=False, latex_font=False):
if latex_font:
# Use LaTex Font
plt.rc('text', usetex=True)
plt.rc('f... | <filename>Evaluation/Plot_pvalueOverTime.py
import matplotlib.pyplot as plt
import seaborn as sns
def plot_pvalue_over_time(df_p_value, value="p-value", max_ylim=False, log=True, plot_file_name=False, latex_font=False):
if latex_font:
# Use LaTex Font
plt.rc('text', usetex=True)
plt.rc('f... | en | 0.378921 | # Use LaTex Font # Create plot # sns.set_theme() | 2.132475 | 2 |
src/run.py | MasakiAsada/MOL_DDIE | 9 | 6628780 | <filename>src/run.py
import sys
import copy
import numpy as np
import time
import pickle as pkl
import yaml
import chainer
from chainer import optimizers, cuda, serializers
import chainer.functions as F
cp = cuda.cupy
from preprocess import to_indx
from model import RelationExtractor
from cnn import CNN
from deepcnn ... | <filename>src/run.py
import sys
import copy
import numpy as np
import time
import pickle as pkl
import yaml
import chainer
from chainer import optimizers, cuda, serializers
import chainer.functions as F
cp = cuda.cupy
from preprocess import to_indx
from model import RelationExtractor
from cnn import CNN
from deepcnn ... | uk | 0.160176 | #if len(sys.argv) != 2: # sys.stderr.write('Usage: python3 %s yamlfile' % (sys.argv[0])) # sys.exit(-1) #pred = F.argmax(p, axis=1) | 2.088895 | 2 |
converter_matriz.py | wmonteiro92/tsp-ga | 0 | 6628781 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 17:40:09 2020
@author: wmont
"""
import numpy as np
def ler_arquivo(file, start_line, end_line):
lines = open(f'{file}.tsp', 'r').read().splitlines()[start_line:end_line]
values = [[int(value) for value in line.split()] for line in lines]
return values
de... | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 17:40:09 2020
@author: wmont
"""
import numpy as np
def ler_arquivo(file, start_line, end_line):
lines = open(f'{file}.tsp', 'r').read().splitlines()[start_line:end_line]
values = [[int(value) for value in line.split()] for line in lines]
return values
de... | pt | 0.523467 | # -*- coding: utf-8 -*- Created on Sat Mar 28 17:40:09 2020 @author: wmont # criando a matriz simétrica # lendo o arquivo # lendo o arquivo # lendo o arquivo | 2.77124 | 3 |
swt_translator/translator.py | PrediktorAS/quarry | 2 | 6628782 | # Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | # Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | en | 0.851094 | # Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa... | 1.829574 | 2 |
PyBank/main.py/main.py | Georgeaziz1985/Python-HW | 0 | 6628783 | <gh_stars>0
# Import modules
import os
import csv
# Define variables
month_count = 0
date_list = []
profit_l_list = []
total_p_l = float(0)
change_value_list = []
prior_value = float(0)
# Define path to budget data csv
csvpath = os.path.join("C:/Users/<NAME>/Desktop/case-homework/python-challenge/PyBank/Resources/bu... | # Import modules
import os
import csv
# Define variables
month_count = 0
date_list = []
profit_l_list = []
total_p_l = float(0)
change_value_list = []
prior_value = float(0)
# Define path to budget data csv
csvpath = os.path.join("C:/Users/<NAME>/Desktop/case-homework/python-challenge/PyBank/Resources/budget_data.cs... | en | 0.759669 | # Import modules # Define variables # Define path to budget data csv # Open csv # Define csv_reader # Identify header of the csv file and skip over it # Loop through the dataset to count months and add to list of dates and profit/loss values # Create list of profit/loss changes month-to-month # Define function to calc ... | 3.731217 | 4 |
anaconda_project/requirements_registry/providers/test/test_redis_provider.py | kathatherine/anaconda-project | 0 | 6628784 | <filename>anaconda_project/requirements_registry/providers/test/test_redis_provider.py<gh_stars>0
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# ... | <filename>anaconda_project/requirements_registry/providers/test/test_redis_provider.py<gh_stars>0
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# ... | en | 0.808832 | # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2016, Anaconda, Inc. All rights reserved. # # Licensed under the terms of the BSD 3-Clause License. # The full license is in the file LICENSE.txt, distributed with this software. # -------------------... | 1.620263 | 2 |
applications/ThermalDEMApplication/python_scripts/thermal_sphere_strategy.py | hbayraktaroglu/Kratos | 0 | 6628785 | # Imports
from KratosMultiphysics import *
from KratosMultiphysics.DEMApplication import *
from KratosMultiphysics.ThermalDEMApplication import *
import KratosMultiphysics.DEMApplication.sphere_strategy as SolverStrategy
import KratosMultiphysics.ThermalDEMApplication.default_input_settings as DefaultSettings
# ... | # Imports
from KratosMultiphysics import *
from KratosMultiphysics.DEMApplication import *
from KratosMultiphysics.ThermalDEMApplication import *
import KratosMultiphysics.DEMApplication.sphere_strategy as SolverStrategy
import KratosMultiphysics.ThermalDEMApplication.default_input_settings as DefaultSettings
# ... | en | 0.240275 | # Imports # Set base class # Auxiliary functions # Strategy class ####################################### DERIVED METHODS ####################################### #---------------------------------------------------------------------------------------------- # Initialize base class # Get and validate input parameters # ... | 1.927109 | 2 |
tests/test_mint.py | LandRegistry/mint-alpha | 0 | 6628786 | <gh_stars>0
import unittest
import mock
import requests
import json
from themint import server
class MintTestCase(unittest.TestCase):
def setUp(self):
server.app.config['TESTING'] = True
self.app = server.app.test_client()
def test_server(self):
self.assertEqual((self.app.get('/')).s... | import unittest
import mock
import requests
import json
from themint import server
class MintTestCase(unittest.TestCase):
def setUp(self):
server.app.config['TESTING'] = True
self.app = server.app.test_client()
def test_server(self):
self.assertEqual((self.app.get('/')).status, '200 ... | en | 0.850602 | #does not 'mint' anything provided the test environment variables remain blank. #validation fails because an integer passed which can't be iterated over #Ideally response json should be checked here to ensure it contains 'Error when minting new' | 3.041978 | 3 |
pkgcore/test/merge/test_engine.py | pombreda/pkgcore | 1 | 6628787 | # Copyright: 2007-2010 <NAME> <<EMAIL>>
# License: GPL2/BSD
import os
from snakeoil.osutils import pjoin
from snakeoil.test.mixins import tempdir_decorator
from pkgcore.fs import livefs
from pkgcore.fs.contents import contentsSet
from pkgcore.merge import engine
from pkgcore.test import TestCase
from pkgcore.test.fs... | # Copyright: 2007-2010 <NAME> <<EMAIL>>
# License: GPL2/BSD
import os
from snakeoil.osutils import pjoin
from snakeoil.test.mixins import tempdir_decorator
from pkgcore.fs import livefs
from pkgcore.fs.contents import contentsSet
from pkgcore.merge import engine
from pkgcore.test import TestCase
from pkgcore.test.fs... | en | 0.777942 | # Copyright: 2007-2010 <NAME> <<EMAIL>> # License: GPL2/BSD # must differ; shouldn't be modifying the original cset # have to add it; scan adds the root node # note that this *is* a sym in the cset; adding this specific # check so that if the code differs, the test breaks, and the tests # get updated (additionally, fol... | 2.100241 | 2 |
tools/downloader/quantizer.py | Aya-ZIbra/open_model_zoo | 4 | 6628788 | <gh_stars>1-10
#!/usr/bin/env python3
# Copyright (c) 2020 Intel Corporation
#
# 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 re... | #!/usr/bin/env python3
# Copyright (c) 2020 Intel Corporation
#
# 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 appli... | en | 0.88301 | #!/usr/bin/env python3 # Copyright (c) 2020 Intel Corporation # # 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 applic... | 2.130897 | 2 |
projects/migrations/0036_project_ownername.py | peppasd/LIT | 2 | 6628789 | <filename>projects/migrations/0036_project_ownername.py
# Generated by Django 3.0.8 on 2020-07-23 16:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0035_auto_20200723_1652'),
]
operations = [
migrations.AddField(
... | <filename>projects/migrations/0036_project_ownername.py
# Generated by Django 3.0.8 on 2020-07-23 16:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0035_auto_20200723_1652'),
]
operations = [
migrations.AddField(
... | en | 0.785731 | # Generated by Django 3.0.8 on 2020-07-23 16:32 | 1.455463 | 1 |
evennia/settings_default.py | davidrideout/evennia | 0 | 6628790 | """
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE!
All settings changes should be done by copy-pasting the variable and
its value to <gamedir>/server/conf/settings.py.
Hint: Don't copy&paste over more from this file than you actually want
to change. Anything you don't cop... | """
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE!
All settings changes should be done by copy-pasting the variable and
its value to <gamedir>/server/conf/settings.py.
Hint: Don't copy&paste over more from this file than you actually want
to change. Anything you don't cop... | en | 0.800471 | Master configuration file for Evennia. NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE! All settings changes should be done by copy-pasting the variable and its value to <gamedir>/server/conf/settings.py. Hint: Don't copy&paste over more from this file than you actually want to change. Anything you don't copy&pa... | 1.943794 | 2 |
openmlpimp/utils/misc.py | kw-corne/openml-pimp | 12 | 6628791 | import arff
import openml
import openmlpimp
import sklearn
from time import gmtime, strftime
def get_time():
return strftime("[%Y-%m-%d %H:%M:%S]", gmtime())
def fixed_parameters_to_suffix(fixed_parameters):
if fixed_parameters is not None and len(fixed_parameters) > 0:
save_folder_suffix = [param +... | import arff
import openml
import openmlpimp
import sklearn
from time import gmtime, strftime
def get_time():
return strftime("[%Y-%m-%d %H:%M:%S]", gmtime())
def fixed_parameters_to_suffix(fixed_parameters):
if fixed_parameters is not None and len(fixed_parameters) > 0:
save_folder_suffix = [param +... | en | 0.176427 | # elif splitted[1] == 'coef0': # return 'tolerance' | 2.336396 | 2 |
databricks/koalas/ml.py | garawalid/spark-pandas | 2 | 6628792 | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | en | 0.807508 | # # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i... | 2.792186 | 3 |
python/pyspark/sql/pandas/functions.py | melin/spark | 2 | 6628793 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | en | 0.508939 | # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us... | 1.941546 | 2 |
comment/admin.py | codingtruman/myblog | 0 | 6628794 | <gh_stars>0
from django.contrib import admin
from .models import *
class CommentAdmin(admin.ModelAdmin):
# choose what to show in article admin page
list_display = ["user", "comment_time", "body"]
# choose what parameters as filters
list_filter = ["user", "comment_time"]
# choose what can be searc... | from django.contrib import admin
from .models import *
class CommentAdmin(admin.ModelAdmin):
# choose what to show in article admin page
list_display = ["user", "comment_time", "body"]
# choose what parameters as filters
list_filter = ["user", "comment_time"]
# choose what can be searched in searc... | en | 0.836837 | # choose what to show in article admin page # choose what parameters as filters # choose what can be searched in search box | 2.153001 | 2 |
gap/exception.py | Labgoo/google-analytics-for-python | 0 | 6628795 | <reponame>Labgoo/google-analytics-for-python<gh_stars>0
__author__ = 'minhtule'
class ValidateException(Exception):
pass
| __author__ = 'minhtule'
class ValidateException(Exception):
pass | none | 1 | 1.124256 | 1 | |
tests/test_il_gaming_board.py | MAYANK25402/city-scrapers | 1 | 6628796 | from datetime import datetime
from os.path import dirname, join
import pytest
from city_scrapers_core.constants import BOARD, PASSED
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from city_scrapers.spiders.il_gaming_board import IlGamingBoardSpider
test_response = file_response... | from datetime import datetime
from os.path import dirname, join
import pytest
from city_scrapers_core.constants import BOARD, PASSED
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from city_scrapers.spiders.il_gaming_board import IlGamingBoardSpider
test_response = file_response... | uz | 0.447735 | # noqa # noqa # noqa # noqa | 2.380965 | 2 |
bpytop.py | jonasbfranco/bpytop | 1 | 6628797 | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member, unsubscriptable-object
# indent = tab
# tab-size = 4
# Copyright 2020 Aristocratos (<EMAIL>)
# 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 ... | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member, unsubscriptable-object
# indent = tab
# tab-size = 4
# Copyright 2020 Aristocratos (<EMAIL>)
# 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 ... | en | 0.622187 | #!/usr/bin/env python3 # pylint: disable=not-callable, no-member, unsubscriptable-object # indent = tab # tab-size = 4 # Copyright 2020 Aristocratos (<EMAIL>) # 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 ... | 2.016348 | 2 |
autoindex.py | langsci/152 | 0 | 6628798 | <reponame>langsci/152<filename>autoindex.py
#!/usr/bin/python3
import glob
import re
lgs=open("locallanguages.txt").read().split('\n')
terms=open("localsubjectterms.txt").read().split('\n')[::-1]#reverse to avoid double indexing
print("found %i language names for autoindexing" % len(lgs))
print("found %i subject term... | #!/usr/bin/python3
import glob
import re
lgs=open("locallanguages.txt").read().split('\n')
terms=open("localsubjectterms.txt").read().split('\n')[::-1]#reverse to avoid double indexing
print("found %i language names for autoindexing" % len(lgs))
print("found %i subject terms for autoindexing" % len(terms))
files = g... | en | 0.647531 | #!/usr/bin/python3 #reverse to avoid double indexing #strip preamble of edited volume chapters to avoid indexing there | 2.562613 | 3 |
src/an_SumArea.py | mbonnema/SWAV | 0 | 6628799 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 8 11:37:11 2021
@author: mbonnema
"""
import numpy as np
def SumArea(A_int,D_int):
A_total = 0
Dates = 0
for key in A_int:
Ai = np.reshape(A_int[key],[37,1])
A_total = A_total + Ai
if len(D_int[key]) == 37:
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 8 11:37:11 2021
@author: mbonnema
"""
import numpy as np
def SumArea(A_int,D_int):
A_total = 0
Dates = 0
for key in A_int:
Ai = np.reshape(A_int[key],[37,1])
A_total = A_total + Ai
if len(D_int[key]) == 37:
... | en | 0.610808 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Dec 8 11:37:11 2021 @author: mbonnema | 3.445489 | 3 |
Text-Transformation/testing_framework.py | cam626/RPEye-Link-Analysis | 2 | 6628800 | from text_extract import TextExtractor
import ngrams
import json
import compare
import os
import unittest
import argparse
################################################
#
# UTILITY FUNCTIONS
#
################################################
'''
Given a path to an html file, open it and return its
contents as a str... | from text_extract import TextExtractor
import ngrams
import json
import compare
import os
import unittest
import argparse
################################################
#
# UTILITY FUNCTIONS
#
################################################
'''
Given a path to an html file, open it and return its
contents as a str... | en | 0.528363 | ################################################ # # UTILITY FUNCTIONS # ################################################ Given a path to an html file, open it and return its contents as a string Given a path to an txt file, open it and return its contents as a list of words Given a path to an txt file, open it and ret... | 3.166755 | 3 |
9term/fipt/P2PLending/partnership/serializers.py | nik-sergeson/bsuir-informatics-labs | 0 | 6628801 | from P2PLending.partnership.models import MoneyRequestPartnershipSuggestion, MoneyProposalPartnershipSuggestion
from rest_framework.serializers import ModelSerializer
class RequestPartnershipSuggestionSerializer(ModelSerializer):
class Meta:
model = MoneyRequestPartnershipSuggestion
fields = ('cre... | from P2PLending.partnership.models import MoneyRequestPartnershipSuggestion, MoneyProposalPartnershipSuggestion
from rest_framework.serializers import ModelSerializer
class RequestPartnershipSuggestionSerializer(ModelSerializer):
class Meta:
model = MoneyRequestPartnershipSuggestion
fields = ('cre... | none | 1 | 2.055885 | 2 | |
db/problems.py | pan-lei/doctor | 2 | 6628802 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/4/12 16:00
# @Author : 潘磊
# @function: 问题文档结构
from mongoengine import *
class Problem(Document):
doctor = StringField(required=True,max_length=5)
hospital = StringField(required=True,max_length=50)
date = DateTimeField(required=True)
url... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/4/12 16:00
# @Author : 潘磊
# @function: 问题文档结构
from mongoengine import *
class Problem(Document):
doctor = StringField(required=True,max_length=5)
hospital = StringField(required=True,max_length=50)
date = DateTimeField(required=True)
url... | zh | 0.47816 | #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/4/12 16:00 # @Author : 潘磊 # @function: 问题文档结构 # 指定集合名称 | 2.164306 | 2 |
scripts/print_epoch_acc.py | searchivarius/OpenNMT-py | 1 | 6628803 | #!/usr/bin/env python
import sys
acc = []
perpl = []
with open(sys.argv[1]) as f:
ln=0
for line in f:
line = line.strip()
ln += 1
if line.startswith('Validation perplexity:'):
if len(acc) != len(perpl):
raise Exception('Bad file format, unbalanced val. perpl. msg in line %d' % ln)
... | #!/usr/bin/env python
import sys
acc = []
perpl = []
with open(sys.argv[1]) as f:
ln=0
for line in f:
line = line.strip()
ln += 1
if line.startswith('Validation perplexity:'):
if len(acc) != len(perpl):
raise Exception('Bad file format, unbalanced val. perpl. msg in line %d' % ln)
... | ru | 0.26433 | #!/usr/bin/env python | 2.723889 | 3 |
dtlpy/entities/annotation_definitions/base_annotation_definition.py | dataloop-ai/dtlpy | 10 | 6628804 | <gh_stars>1-10
import logging
import numpy as np
logger = logging.getLogger(name=__name__)
class BaseAnnotationDefinition:
def __init__(self, description=None, attributes=None):
self.description = description
self._top = 0
self._left = 0
self._bottom = 0
self._right = 0
... | import logging
import numpy as np
logger = logging.getLogger(name=__name__)
class BaseAnnotationDefinition:
def __init__(self, description=None, attributes=None):
self.description = description
self._top = 0
self._left = 0
self._bottom = 0
self._right = 0
if attri... | en | 0.576414 | :param image: :param annotation: | 2.739262 | 3 |
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/reload/iosxe/c3850/reload.py | jbronikowski/genielibs | 94 | 6628805 | <reponame>jbronikowski/genielibs
'''IOSXE implementation for Reload triggers'''
# import python
import logging
# import pyats
from pyats import aetest
from pyats.utils.objects import R
# Genie Libs
from genie.libs.sdk.libs.utils.mapping import Mapping
from genie.libs.sdk.triggers.ha.ha import \
... | '''IOSXE implementation for Reload triggers'''
# import python
import logging
# import pyats
from pyats import aetest
from pyats.utils.objects import R
# Genie Libs
from genie.libs.sdk.libs.utils.mapping import Mapping
from genie.libs.sdk.triggers.ha.ha import \
TriggerReload as CommonReload, ... | en | 0.786459 | IOSXE implementation for Reload triggers # import python # import pyats # Genie Libs # from genie.libs import parser # Trigger required data settings # Which key to exclude for Platform Ops comparison Reload the whole device. Reload the whole device. trigger_datafile: Mandatory: timeout: ... | 2.270993 | 2 |
gracz.py | cz-maria/Pawel_the_Mage | 0 | 6628806 | import pygame
import stale
class Player(pygame.sprite.Sprite):
""" <NAME> """
walking_frames_l = []
walking_frames_r = []
direction = "R"
# -- Methods
def __init__(self,color):
super().__init__()
if color == 0:
image_r = pygame.image.load("mage... | import pygame
import stale
class Player(pygame.sprite.Sprite):
""" <NAME> """
walking_frames_l = []
walking_frames_r = []
direction = "R"
# -- Methods
def __init__(self,color):
super().__init__()
if color == 0:
image_r = pygame.image.load("mage... | en | 0.842164 | <NAME> # -- Methods # Set speed vector of player # List of sprites we can bump against Move the player. # Gravity # Move left/right #pos = self.rect.x # See if we hit anything # If we are moving right, # set our right side to the left side of the item we hit # Otherwise if we are moving left, do the opposite. # Move up... | 3.109126 | 3 |
qpython/utils.py | nugend/qPython | 5 | 6628807 | <reponame>nugend/qPython
# Copyright (c) 2011-2014 Exxeleron GmbH
#
# 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... | # Copyright (c) 2011-2014 Exxeleron GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | en | 0.834662 | # Copyright (c) 2011-2014 Exxeleron GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed... | 2.65697 | 3 |
{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/pipelines.py | naidu-rohit/ds_template | 0 | 6628808 | import dagster as dag
import yaml
from datetime import datetime
from dagster import pipeline, PresetDefinition
from {{cookiecutter.package_name}}.tasks.features import *
from {{cookiecutter.package_name}}.tasks.preprocess import *
from {{cookiecutter.package_name}}.tasks.train import *
from {{cookiecutter.package_name}... | import dagster as dag
import yaml
from datetime import datetime
from dagster import pipeline, PresetDefinition
from {{cookiecutter.package_name}}.tasks.features import *
from {{cookiecutter.package_name}}.tasks.preprocess import *
from {{cookiecutter.package_name}}.tasks.train import *
from {{cookiecutter.package_name}... | none | 1 | 2.106354 | 2 | |
mooringlicensing/migrations/0232_auto_20210825_1609.py | jawaidm/mooringlicensing | 0 | 6628809 | <filename>mooringlicensing/migrations/0232_auto_20210825_1609.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-08-25 08:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mooringlicensing', '0231_a... | <filename>mooringlicensing/migrations/0232_auto_20210825_1609.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-08-25 08:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mooringlicensing', '0231_a... | en | 0.686419 | # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-08-25 08:09 | 1.476777 | 1 |
services/core-api/app/api/now_applications/resources/now_application_type_resource.py | parc-jason/mds | 0 | 6628810 | from flask_restplus import Resource
from app.extensions import api
from app.api.utils.access_decorators import requires_role_view_all
from app.api.utils.resources_mixins import UserMixin
from app.api.now_applications.models.now_application_type import NOWApplicationType
from app.api.now_applications.response_models i... | from flask_restplus import Resource
from app.extensions import api
from app.api.utils.access_decorators import requires_role_view_all
from app.api.utils.resources_mixins import UserMixin
from app.api.now_applications.models.now_application_type import NOWApplicationType
from app.api.now_applications.response_models i... | none | 1 | 1.815621 | 2 | |
detection/detect.py | DoomsdayT/Raspberry-Pi-Fall-Detection | 1 | 6628811 | from .models.expert import fallDetect as expertDetect
def detect(acc_series):
return int(expertDetect(acc_series)) * 1.0
if __name__ == '__main__':
print(detect([9.0, 10.0, 12.0, 5.0, 7.0]))
| from .models.expert import fallDetect as expertDetect
def detect(acc_series):
return int(expertDetect(acc_series)) * 1.0
if __name__ == '__main__':
print(detect([9.0, 10.0, 12.0, 5.0, 7.0]))
| none | 1 | 2.040396 | 2 | |
test.py | mgtremaine/py_tracking_urls | 1 | 6628812 | #!/usr/bin/python3
#Simple test values
#Missing Mail Innovations test
import py_tracking_urls
errors = False
numbers = {
#TEST UPS
'1Z9999W99999999999' : 'ups.com',
'1Z12345E1512345676' : 'ups.com',
'1Z12345E0205271688' : 'ups.com',
'1Z12345E6605272234' : 'ups.com',
'1Z12345E0305271640' : 'ups.com',... | #!/usr/bin/python3
#Simple test values
#Missing Mail Innovations test
import py_tracking_urls
errors = False
numbers = {
#TEST UPS
'1Z9999W99999999999' : 'ups.com',
'1Z12345E1512345676' : 'ups.com',
'1Z12345E0205271688' : 'ups.com',
'1Z12345E6605272234' : 'ups.com',
'1Z12345E0305271640' : 'ups.com',... | en | 0.3463 | #!/usr/bin/python3 #Simple test values #Missing Mail Innovations test #TEST UPS #TEST FEDEX #TEST USPS #TEST ONTRAC #TEST DHL #TEST DHL GLOBAL #Royal Mail #INVALID TRACKING NUMBERS | 1.997973 | 2 |
python/UdemyCourse/2022_Python_Bootcamp/basics/python_statements/__init__.py | pradyotprksh/development_learning | 9 | 6628813 | <filename>python/UdemyCourse/2022_Python_Bootcamp/basics/python_statements/__init__.py
from .if_elif_else import if_elif_else_basics
from .for_loops import for_loops_basics
from .while_loops import while_loops_basics
from .useful_operators import useful_operators
| <filename>python/UdemyCourse/2022_Python_Bootcamp/basics/python_statements/__init__.py
from .if_elif_else import if_elif_else_basics
from .for_loops import for_loops_basics
from .while_loops import while_loops_basics
from .useful_operators import useful_operators
| none | 1 | 1.839769 | 2 | |
Exercicios/ex028.py | AndreyPaceli/Python3-CursoEmVideo | 0 | 6628814 | #Escreva um programa que faça o computador “pensar” em um número inteiro entre 0 e 5 e peça para o usuário tentar descobrir qual foi o número escolhido pelo computador. O programa deverá escrever na tela se o usuário venceu ou perdeu
from random import randint
from time import sleep
computador = randint(0,5) #Faz o c... | #Escreva um programa que faça o computador “pensar” em um número inteiro entre 0 e 5 e peça para o usuário tentar descobrir qual foi o número escolhido pelo computador. O programa deverá escrever na tela se o usuário venceu ou perdeu
from random import randint
from time import sleep
computador = randint(0,5) #Faz o c... | pt | 0.9794 | #Escreva um programa que faça o computador “pensar” em um número inteiro entre 0 e 5 e peça para o usuário tentar descobrir qual foi o número escolhido pelo computador. O programa deverá escrever na tela se o usuário venceu ou perdeu #Faz o computador "PENSAR" #Jogador tenta adivinhar | 4.221844 | 4 |
apps/tickets/migrations/0008_auto_20180522_2317.py | RonaldTheodoro/tcc-simple-ticket | 0 | 6628815 | <gh_stars>0
# Generated by Django 2.0.5 on 2018-05-23 02:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tickets', '0007_auto_20180522_2312'),
]
operations = [
migrations.AlterField(
model... | # Generated by Django 2.0.5 on 2018-05-23 02:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tickets', '0007_auto_20180522_2312'),
]
operations = [
migrations.AlterField(
model_name='task'... | en | 0.764968 | # Generated by Django 2.0.5 on 2018-05-23 02:17 | 1.375242 | 1 |
dfvfs/resolver/compressed_stream_resolver_helper.py | Defense-Cyber-Crime-Center/dfvfs | 2 | 6628816 | <filename>dfvfs/resolver/compressed_stream_resolver_helper.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""The compressed stream path specification resolver helper implementation."""
# This is necessary to prevent a circular import.
import dfvfs.file_io.compressed_stream_io
import dfvfs.vfs.compressed_stream_file_system
... | <filename>dfvfs/resolver/compressed_stream_resolver_helper.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""The compressed stream path specification resolver helper implementation."""
# This is necessary to prevent a circular import.
import dfvfs.file_io.compressed_stream_io
import dfvfs.vfs.compressed_stream_file_system
... | en | 0.743544 | # -*- coding: utf-8 -*- The compressed stream path specification resolver helper implementation. # This is necessary to prevent a circular import. Class that implements the compressed stream resolver helper. Creates a new file-like object. Args: resolver_context: the resolver context (instance of resolver.Co... | 2.062749 | 2 |
introduction/arithmetic_operators.py | pk-hackerrank/python | 1 | 6628817 | <reponame>pk-hackerrank/python<filename>introduction/arithmetic_operators.py<gh_stars>1-10
def printArthmeticOperationalValues(a,b):
print(a+b)
print(a-b)
print(a*b)
if __name__ == '__main__':
a = int(input())
b = int(input())
printArthmeticOperationalValues(a,b)
| def printArthmeticOperationalValues(a,b):
print(a+b)
print(a-b)
print(a*b)
if __name__ == '__main__':
a = int(input())
b = int(input())
printArthmeticOperationalValues(a,b) | none | 1 | 3.621407 | 4 | |
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/aws_ecr/__init__.py | chriscoombs/amazon-sagemaker-cdk-examples | 41 | 6628818 | <reponame>chriscoombs/amazon-sagemaker-cdk-examples
"""
## Amazon ECR Construct Library
<!--BEGIN STABILITY BANNER-->---

---
<!--END STABILITY BANNER-->
This package contains constructs for working with Amazon Elast... | """
## Amazon ECR Construct Library
<!--BEGIN STABILITY BANNER-->---

---
<!--END STABILITY BANNER-->
This package contains constructs for working with Amazon Elastic Container Registry.
### Repositories
Define a r... | en | 0.79024 | ## Amazon ECR Construct Library <!--BEGIN STABILITY BANNER-->---  --- <!--END STABILITY BANNER--> This package contains constructs for working with Amazon Elastic Container Registry. ### Repositories Define a repos... | 2.002849 | 2 |
wastetowealth/views.py | BuildForSDG/waste-to-wealth | 0 | 6628819 | <reponame>BuildForSDG/waste-to-wealth
# # from django.shortcuts import render
# # Create your views here.
# from django.contrib.auth.hashers import make_password
# from django.contrib.auth import login, authenticate
# from django.contrib.auth.models import User, Group
# from rest_framework import status, viewsets
# fr... | # # from django.shortcuts import render
# # Create your views here.
# from django.contrib.auth.hashers import make_password
# from django.contrib.auth import login, authenticate
# from django.contrib.auth.models import User, Group
# from rest_framework import status, viewsets
# from .serializers import UserSerializer
... | en | 0.50537 | # # from django.shortcuts import render # # Create your views here. # from django.contrib.auth.hashers import make_password # from django.contrib.auth import login, authenticate # from django.contrib.auth.models import User, Group # from rest_framework import status, viewsets # from .serializers import UserSerializer #... | 2.141834 | 2 |
pysite/migrations/tables/code_jam_teams/v1.py | gatarelib/site | 0 | 6628820 | def run(db, table, table_obj):
"""
Associate the ID of each team's code jam (team -> jam)
"""
for document in db.get_all(table):
if "jam" not in document:
# find the code jam containing this team
for jam in db.get_all("code_jams"):
if document["id"] in ja... | def run(db, table, table_obj):
"""
Associate the ID of each team's code jam (team -> jam)
"""
for document in db.get_all(table):
if "jam" not in document:
# find the code jam containing this team
for jam in db.get_all("code_jams"):
if document["id"] in ja... | en | 0.830315 | Associate the ID of each team's code jam (team -> jam) # find the code jam containing this team | 2.942111 | 3 |
validator/tests/test_message_validation/tests.py | andyyumao/sawtooth | 4 | 6628821 | <filename>validator/tests/test_message_validation/tests.py
# Copyright 2016 Intel Corporation
#
# 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.... | <filename>validator/tests/test_message_validation/tests.py
# Copyright 2016 Intel Corporation
#
# 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.... | en | 0.688079 | # Copyright 2016 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri... | 1.884885 | 2 |
aliyun-python-sdk-mse/aliyunsdkmse/request/v20190531/CreateClusterRequest.py | yndu13/aliyun-openapi-python-sdk | 0 | 6628822 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | en | 0.79981 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 1.649088 | 2 |
day03.py | suntingting521/suntingting1170426002 | 0 | 6628823 | import requests
url = 'http://www.baidu.com/s?'
def baidu(wds):
count = 1
for wd in wds:
res = requests.get(url,params={'wd':wd})
path = 'res%d.txt'%count
with open(path,'w',encoding='utf8') as f:
f.write(res.text)
count +=1
if __name__ == "__main__":
... | import requests
url = 'http://www.baidu.com/s?'
def baidu(wds):
count = 1
for wd in wds:
res = requests.get(url,params={'wd':wd})
path = 'res%d.txt'%count
with open(path,'w',encoding='utf8') as f:
f.write(res.text)
count +=1
if __name__ == "__main__":
... | none | 1 | 3.001575 | 3 | |
src/kafka_utils/base_consumer.py | Evcom-Lab/kafka-utils | 0 | 6628824 | from multiprocessing import Process
from confluent_kafka import Consumer
from abc import ABC, abstractmethod, abstractproperty
import sys
import ast
import logging
from functools import wraps
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('consumer')
def multiprocess(fn):
@wraps(fn)
def c... | from multiprocessing import Process
from confluent_kafka import Consumer
from abc import ABC, abstractmethod, abstractproperty
import sys
import ast
import logging
from functools import wraps
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('consumer')
def multiprocess(fn):
@wraps(fn)
def c... | none | 1 | 2.753721 | 3 | |
racovimge/racovimge.py | MohamedAliRashad/racovimge | 0 | 6628825 | #!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import base64
import jinja2
import os.path
import pathlib
import random as rand
import shutil
import subprocess
import... | #!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import base64
import jinja2
import os.path
import pathlib
import random as rand
import shutil
import subprocess
import... | de | 0.785952 | #!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### ############################################################################### # Helper Functins ######################... | 2.488957 | 2 |
abc065/c.py | y-sira/atcoder | 0 | 6628826 | <reponame>y-sira/atcoder
import sys
import math
def main():
n, m = map(int, input().split())
diff = abs(n - m)
if diff > 1:
print(0)
return 0
if diff == 1:
print(math.factorial(n) * math.factorial(m) % (10 ** 9 + 7))
else:
print(math.factorial(n) * math.factoria... | import sys
import math
def main():
n, m = map(int, input().split())
diff = abs(n - m)
if diff > 1:
print(0)
return 0
if diff == 1:
print(math.factorial(n) * math.factorial(m) % (10 ** 9 + 7))
else:
print(math.factorial(n) * math.factorial(m) * 2 % (10 ** 9 + 7))... | none | 1 | 3.364967 | 3 | |
setup.py | PGM-Lab/bcause | 0 | 6628827 | import re
import sys
import setuptools
import os
if sys.version_info < (3, 6):
sys.exit('Python < 3.6 is not supported')
# get abs path from this folder name
here = os.path.dirname(os.path.abspath(__file__))
print(here)
# open __init__.py, where version is specified
with open(os.path.join(here... | import re
import sys
import setuptools
import os
if sys.version_info < (3, 6):
sys.exit('Python < 3.6 is not supported')
# get abs path from this folder name
here = os.path.dirname(os.path.abspath(__file__))
print(here)
# open __init__.py, where version is specified
with open(os.path.join(here... | en | 0.709804 | # get abs path from this folder name # open __init__.py, where version is specified # try to read it from source code # get long description from file in docs folder # Replace with your own username #package_dir={'': 'bcause'}, #extras_require=dict(tests=['pytest']) | 1.983793 | 2 |
tensorflow/test_utils.py | mixuala/fast-neural-style-pytorch | 1 | 6628828 | <reponame>mixuala/fast-neural-style-pytorch
import tensorflow as tf
import numpy as np
import PIL.Image
from fast_neural_style_pytorch.tensorflow import utils as fnstf_utils
from fast_neural_style_pytorch.tensorflow import vgg as tf_vgg
from fast_neural_style_pytorch.tensorflow import transformer as tf_transformer
... | import tensorflow as tf
import numpy as np
import PIL.Image
from fast_neural_style_pytorch.tensorflow import utils as fnstf_utils
from fast_neural_style_pytorch.tensorflow import vgg as tf_vgg
from fast_neural_style_pytorch.tensorflow import transformer as tf_transformer
class TransformerNetwork_VGG_ONES(tf.kera... | en | 0.653347 | TransformerNetwork_VGG that returns outputs as tf.ones() # output_shapes = [(BATCH_SIZZE, 16, 16, 512), (BATCH_SIZZE, 64, 64), (BATCH_SIZZE, 128, 128), (BATCH_SIZZE, 256, 256), (BATCH_SIZZE, 512, 512), (BATCH_SIZZE, 512, 512)] "use when style_image.shape != (256,256,3) # ### unit tests # static features: features = VG... | 2.373272 | 2 |
manage.py | xflows/textflows | 18 | 6628829 | <reponame>xflows/textflows
#!/usr/bin/env python
# Copyright (C) <2014> <NAME>
import os, sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mothra.settings')
from django.core.management import execute_from_command_line
from django.conf import settings
if hasattr(setti... | #!/usr/bin/env python
# Copyright (C) <2014> <NAME>
import os, sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mothra.settings')
from django.core.management import execute_from_command_line
from django.conf import settings
if hasattr(settings, "LATINO_BIN_PATH"):
... | en | 0.193721 | #!/usr/bin/env python # Copyright (C) <2014> <NAME> | 1.620585 | 2 |
config/traces.py | JRPan/gltracesim | 11 | 6628830 | class Trace:
def __init__(self, name, input = None, fast_forward = 0, sim_end = 1E6, trace=False):
self.name = name
self.input = input
self.fast_forward = fast_forward
self.sim_end = sim_end
self.trace = trace
traces = [
Trace(
name="telemetry_youtube",
i... | class Trace:
def __init__(self, name, input = None, fast_forward = 0, sim_end = 1E6, trace=False):
self.name = name
self.input = input
self.fast_forward = fast_forward
self.sim_end = sim_end
self.trace = trace
traces = [
Trace(
name="telemetry_youtube",
i... | none | 1 | 2.443939 | 2 | |
mapper/getCLIPscores.py | Dokhyam/StyleCLIP | 0 | 6628831 | import os
import torch
from models.stylegan2.model import Generator
directions_path = '/disk1/dokhyam/StyleCLIP/directions/'
image_latents = torch.load('/disk1/dokhyam/StyleCLIP/mapper/latent_data/train_faces.pt')
directions_list = os.listdir(directions_path)
image_ind = 0
StyleGANGenerator = Generator(1024,512,8)
for... | import os
import torch
from models.stylegan2.model import Generator
directions_path = '/disk1/dokhyam/StyleCLIP/directions/'
image_latents = torch.load('/disk1/dokhyam/StyleCLIP/mapper/latent_data/train_faces.pt')
directions_list = os.listdir(directions_path)
image_ind = 0
StyleGANGenerator = Generator(1024,512,8)
for... | none | 1 | 2.051907 | 2 | |
src/pymcprotocol/type4e.py | tyaro/pymcprotocol | 0 | 6628832 | """This file implements mcprotocol 4E type communication.
"""
import re
import socket
from . import mcprotocolerror
from . import mcprotocolconst as const
from .type3e import Type3E
class Type4E(Type3E):
"""mcprotocol 4E communication class.
Type 4e is almost same to Type 3E. Difference is only subheader.
... | """This file implements mcprotocol 4E type communication.
"""
import re
import socket
from . import mcprotocolerror
from . import mcprotocolconst as const
from .type3e import Type3E
class Type4E(Type3E):
"""mcprotocol 4E communication class.
Type 4e is almost same to Type 3E. Difference is only subheader.
... | en | 0.479408 | This file implements mcprotocol 4E type communication. mcprotocol 4E communication class. Type 4e is almost same to Type 3E. Difference is only subheader. So, Changed self.subhear and self._make_senddata() Arributes: subheader(int): Subheader for mc protocol subheaderserial(int): ... | 2.904643 | 3 |
UNET/nets.py | zz00zws/magic_learning | 1 | 6628833 | import torch.nn as nn
import torch
import cfg
device = torch.device("cpu" if torch.cuda.is_available() else "cpu")
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class conv(nn.Module):
def __init__(self,x,y,z,p=0,s=1,b=True):
super().__init__()
self.block1=nn.Se... | import torch.nn as nn
import torch
import cfg
device = torch.device("cpu" if torch.cuda.is_available() else "cpu")
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class conv(nn.Module):
def __init__(self,x,y,z,p=0,s=1,b=True):
super().__init__()
self.block1=nn.Se... | en | 0.311998 | #device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # net2=fc() # z=torch.randn(5,256) # b=net2(z) | 2.750445 | 3 |
corehq/apps/domain/forms.py | bglar/commcare-hq | 1 | 6628834 | <reponame>bglar/commcare-hq<gh_stars>1-10
import copy
import logging
from urlparse import urlparse, parse_qs
import dateutil
import re
import io
from PIL import Image
import uuid
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import UNUSABLE_PASSWORD
from corehq import privileges
from c... | import copy
import logging
from urlparse import urlparse, parse_qs
import dateutil
import re
import io
from PIL import Image
import uuid
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import UNUSABLE_PASSWORD
from corehq import privileges
from corehq.apps.accounting.exceptions import Su... | en | 0.740227 | # used to resize uploaded custom logos, aspect ratio is preserved Form for updating a user's project settings # http://stackoverflow.com/questions/4356538/how-can-i-extract-video-id-from-youtubes-link-in-python#answer-7936523 Examples: - http://youtu.be/SA2iWivDJiE - http://www.youtube.com/watch... | 1.377663 | 1 |
tools/run_kotlin_benchmarks.py | demon-xxi/r8 | 8 | 6628835 | #!/usr/bin/env python
# Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Script for running kotlin based benchmarks
import golem
import optparse
import os
im... | #!/usr/bin/env python
# Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Script for running kotlin based benchmarks
import golem
import optparse
import os
im... | en | 0.824541 | #!/usr/bin/env python # Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. # Script for running kotlin based benchmarks # From Android rules -keepclasseswithmember... | 2.069517 | 2 |
ontask/action/views/edit_personalized.py | pinheiroo27/ontask_b | 33 | 6628836 | # -*- coding: utf-8 -*-
"""Views to edit actions that send personalized information."""
from typing import Optional
from django import http
from django.contrib.auth.decorators import user_passes_test
from django.template.loader import render_to_string
from django.urls import reverse
from django.views.decorators.csrf ... | # -*- coding: utf-8 -*-
"""Views to edit actions that send personalized information."""
from typing import Optional
from django import http
from django.contrib.auth.decorators import user_passes_test
from django.template.loader import render_to_string
from django.urls import reverse
from django.views.decorators.csrf ... | en | 0.804724 | # -*- coding: utf-8 -*- Views to edit actions that send personalized information. Save text content of the action. :param request: HTTP request (POST) :param pk: Action ID :param workflow: Workflow being manipulated (set by the decorators) :param action: Action being saved (set by the decorators) :... | 2.217854 | 2 |
gui/settingspanel.py | yemikudaisi/GIS-Lite | 2 | 6628837 | <reponame>yemikudaisi/GIS-Lite<filename>gui/settingspanel.py<gh_stars>1-10
import wx
class SettingsPanel(wx.Dialog):
def __init__(self, settings, *args, **kwargs):
wx.Dialog.__init__(self, *args, **kwargs)
self.settings = settings
self.panel = wx.Panel(self)
self.button_ok = wx.But... | import wx
class SettingsPanel(wx.Dialog):
def __init__(self, settings, *args, **kwargs):
wx.Dialog.__init__(self, *args, **kwargs)
self.settings = settings
self.panel = wx.Panel(self)
self.button_ok = wx.Button(self.panel, label="OK")
self.button_cancel = wx.Button(self.pan... | none | 1 | 2.281349 | 2 | |
tnetwork/utils/bidict/_abc.py | tomjorquera/tnetwork | 4 | 6628838 | <filename>tnetwork/utils/bidict/_abc.py
# -*- coding: utf-8 -*-
# Copyright 2017 <NAME>. All Rights Reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Provi... | <filename>tnetwork/utils/bidict/_abc.py
# -*- coding: utf-8 -*-
# Copyright 2017 <NAME>. All Rights Reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Provi... | en | 0.682314 | # -*- coding: utf-8 -*- # Copyright 2017 <NAME>. All Rights Reserved. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. Provides bidict ABCs. # pylint: disable=abstract-... | 2.172283 | 2 |
codewar/Counting Duplicates-7k/Counting Duplicates.py | z7211979/practise-Python | 1 | 6628839 | <reponame>z7211979/practise-Python
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import cw as test
debug = 1
def debug_print(flag, out):
if debug:
print("temp" + str(flag) + ":" + str(out))
def duplicate_count(text):
# Your code goes here
out_temp = 0
count_t = [0] * 128
for temp in text:... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import cw as test
debug = 1
def debug_print(flag, out):
if debug:
print("temp" + str(flag) + ":" + str(out))
def duplicate_count(text):
# Your code goes here
out_temp = 0
count_t = [0] * 128
for temp in text:
if ord(temp) >= ord('a') ... | en | 0.37242 | #!/usr/bin/python3 # -*- coding: utf-8 -*- # Your code goes here def duplicate_count(s): return len([c for c in set(s.lower()) if s.lower().count(c)>1]) | 3.902939 | 4 |
vtp/models.py | CzechInvest/ciis | 1 | 6628840 | <gh_stars>1-10
from django.db import models
from addresses.models import Address
from django.utils.translation import ugettext_lazy as _
class VtpType(models.Model):
type = models.CharField(
max_length=16
)
def __str__(self):
return self.type
class Service(models.Model):
servic... | from django.db import models
from addresses.models import Address
from django.utils.translation import ugettext_lazy as _
class VtpType(models.Model):
type = models.CharField(
max_length=16
)
def __str__(self):
return self.type
class Service(models.Model):
service = models.Char... | none | 1 | 2.226928 | 2 | |
recsys_challenge/loader.py | pilipolio/recsys_challenge | 1 | 6628841 | <reponame>pilipolio/recsys_challenge<gh_stars>1-10
import os
import pandas as pd
import numpy as np
BUYS_COLUMNS = ['SESSION_ID', 'TS', 'ITEM_ID', 'PRICE', 'Q']
CLICKS_COLUMNS = ['SESSION_ID', 'TS', 'ITEM_ID', 'CATEGORY']
def time_collapsed_clicks(clicks):
"""
>>> clicks_columns = ['SESSION_ID', 'TS', 'ITE... | import os
import pandas as pd
import numpy as np
BUYS_COLUMNS = ['SESSION_ID', 'TS', 'ITEM_ID', 'PRICE', 'Q']
CLICKS_COLUMNS = ['SESSION_ID', 'TS', 'ITEM_ID', 'CATEGORY']
def time_collapsed_clicks(clicks):
"""
>>> clicks_columns = ['SESSION_ID', 'TS', 'ITEM_ID', 'CATEGORY']
>>> clicks_logs = [[1, 't0',... | en | 0.72686 | >>> clicks_columns = ['SESSION_ID', 'TS', 'ITEM_ID', 'CATEGORY'] >>> clicks_logs = [[1, 't0', 10, 0], [1, 't1', 20, 0], [1, 't2', 20, 0]] >>> clicks = pd.DataFrame(columns=clicks_columns, data=clicks_logs) >>> time_collapsed_clicks(clicks) SESSION_ID ITEM_ID CATEGORY ITEM_START ITEM_STOP N_CLICKS... | 2.683087 | 3 |
mitmproxy/proxy/layers/http/__init__.py | waterdrops/mitmproxy | 1 | 6628842 | <filename>mitmproxy/proxy/layers/http/__init__.py
import collections
import enum
import time
from dataclasses import dataclass
from typing import DefaultDict, Dict, List, Optional, Tuple, Union
import wsproto.handshake
from mitmproxy import flow, http
from mitmproxy.connection import Connection, Server
from mitmproxy... | <filename>mitmproxy/proxy/layers/http/__init__.py
import collections
import enum
import time
from dataclasses import dataclass
from typing import DefaultDict, Dict, List, Optional, Tuple, Union
import wsproto.handshake
from mitmproxy import flow, http
from mitmproxy.connection import Connection, Server
from mitmproxy... | en | 0.92779 | Open an HTTP Connection. This may not actually open a connection, but return an existing HTTP connection instead. connection object, error message Register that a HTTP connection attempt has been completed. # Determine .scheme, .host and .port attributes for transparent requests # We need to extract destination informa... | 2.136348 | 2 |
toscaparser/tosca_template.py | mikidep/tosca-parser | 99 | 6628843 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | en | 0.779422 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d... | 1.441108 | 1 |
app/models/dashboard.py | mateusvarelo/viz_web | 0 | 6628844 | import dash
import dash_core_components as dcc
import dash_html_components as html
from .plotagem import cria_fig_vertical_barra,cores_padrao,cria_fig_horizontal_barra,cria_grafico_linha_youtube
"""Nesse modulo será possivel criar um layout para a pagina do dashboard"""
def init_dashboard(server):
"""Create a... | import dash
import dash_core_components as dcc
import dash_html_components as html
from .plotagem import cria_fig_vertical_barra,cores_padrao,cria_fig_horizontal_barra,cria_grafico_linha_youtube
"""Nesse modulo será possivel criar um layout para a pagina do dashboard"""
def init_dashboard(server):
"""Create a... | pt | 0.878535 | Nesse modulo será possivel criar um layout para a pagina do dashboard Create a Plotly Dash dashboard como um servidor dash. Estilo css para a pagina #Inicializando App dash Definição de cores padrão Create Dash Layout Gráfico de barra ertical com dados de genêros, primeiros 7 generos mais ouvidos Gráficos pronto para ... | 3.064654 | 3 |
src/reinforce.py | jarbus/hackRPI2019 | 0 | 6628845 | <gh_stars>0
""" Policy Gradient optimizer for the Recovery environment, based on https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5#file-pg-pong-py-L68 """
import gym
import numpy as np
# Model Parameters
hidden_n = 4
input_n = 9
output_n = 2
def sigmoid(x: np.array) -> np.array:
return 1.0/(1.0 +... | """ Policy Gradient optimizer for the Recovery environment, based on https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5#file-pg-pong-py-L68 """
import gym
import numpy as np
# Model Parameters
hidden_n = 4
input_n = 9
output_n = 2
def sigmoid(x: np.array) -> np.array:
return 1.0/(1.0 + np.exp(-x))... | en | 0.738964 | Policy Gradient optimizer for the Recovery environment, based on https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5#file-pg-pong-py-L68 # Model Parameters Optimization Parameters learning_rate gamma - Reduced effect of reward on earlier actions decay_rate - RMSProp decay factor # ... | 2.464388 | 2 |
ex090.py | dsjocimar/python | 0 | 6628846 | # Exercício 090
boletim = dict()
boletim['Nome'] = str(input('Nome: '))
boletim['Media'] = float(input(f'Média de {boletim["Nome"]}: '))
if boletim['Media'] >= 7:
boletim['Situaçao'] = 'Aprovado'
else:
boletim['Situaçao'] = 'Reprovado'
for k, v in boletim.items():
print(f'{k} é igual a {v}')
| # Exercício 090
boletim = dict()
boletim['Nome'] = str(input('Nome: '))
boletim['Media'] = float(input(f'Média de {boletim["Nome"]}: '))
if boletim['Media'] >= 7:
boletim['Situaçao'] = 'Aprovado'
else:
boletim['Situaçao'] = 'Reprovado'
for k, v in boletim.items():
print(f'{k} é igual a {v}')
| pt | 0.962807 | # Exercício 090 | 3.67908 | 4 |
parser_lib/parser.py | mdcallag/mysql-tools | 226 | 6628847 | # Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.687009 | # Copyright 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.535264 | 3 |
src/pybel/struct/mutation/induction/neighborhood.py | aman527/pybel | 103 | 6628848 | # -*- coding: utf-8 -*-
"""Functions for selecting by the neighborhoods of nodes."""
import itertools as itt
from typing import Iterable, Optional
from ...graph import BELGraph
from ...pipeline import transformation
from ...utils import update_metadata
from ....dsl import BaseEntity
__all__ = [
'get_subgraph_by... | # -*- coding: utf-8 -*-
"""Functions for selecting by the neighborhoods of nodes."""
import itertools as itt
from typing import Iterable, Optional
from ...graph import BELGraph
from ...pipeline import transformation
from ...utils import update_metadata
from ....dsl import BaseEntity
__all__ = [
'get_subgraph_by... | en | 0.901093 | # -*- coding: utf-8 -*- Functions for selecting by the neighborhoods of nodes. Get a BEL graph around the neighborhoods of the given nodes. Returns none if no nodes are in the graph. :param graph: A BEL graph :param nodes: An iterable of BEL nodes :return: A BEL graph induced around the neighborhoods ... | 3.1113 | 3 |
cl/nets/q_nets.py | tarod13/DRIM | 3 | 6628849 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
from nets.custom_layers import Linear_noisy, parallel_Linear
from nets.vision_nets import vision_Net
from nets.net_utils import weights_init_rnd
use_cuda = torch.cuda.is_available()
device = torch.device("cuda" if use_cu... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
from nets.custom_layers import Linear_noisy, parallel_Linear
from nets.vision_nets import vision_Net
from nets.net_utils import weights_init_rnd
use_cuda = torch.cuda.is_available()
device = torch.device("cuda" if use_cu... | pt | 0.13232 | # Continuous action space #------------------------------------------------- # Discrete action space #------------------------------------------------- | 2.604451 | 3 |
office365.py | ahmadfaizalbh/MS-Office-365-Mailer | 1 | 6628850 | <reponame>ahmadfaizalbh/MS-Office-365-Mailer<gh_stars>1-10
import datetime
import urllib2
import urllib
import json
import time
import os
class MSOFileHandler:
'''Attachment File handler'''
def __init__(self, def_read_dir="", def_write_dir=""):
'''Default Initializer function'''
self.default... | import datetime
import urllib2
import urllib
import json
import time
import os
class MSOFileHandler:
'''Attachment File handler'''
def __init__(self, def_read_dir="", def_write_dir=""):
'''Default Initializer function'''
self.default_read_dir = def_read_dir + ("" if def_read_dir.\
... | en | 0.520385 | Attachment File handler Default Initializer function Attachment name and content is read and create's new file in local system Takes File name (with absolute or complete path) and returns a dictionary of attributes needed for attachment of file in Microsoft mail A microsoft 365 Outlook access ... | 3.189893 | 3 |