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 |
|---|---|---|---|---|---|---|---|---|---|---|
db/migrations/0085_remove_student_job_position.py | matchd-ch/matchd-backend | 1 | 6624451 | # Generated by Django 3.1.5 on 2021-04-06 13:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('db', '0084_remove_company_job_positions'),
]
operations = [
migrations.RemoveField(
model_name='student',
name='job_position... | # Generated by Django 3.1.5 on 2021-04-06 13:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('db', '0084_remove_company_job_positions'),
]
operations = [
migrations.RemoveField(
model_name='student',
name='job_position... | en | 0.830319 | # Generated by Django 3.1.5 on 2021-04-06 13:27 | 1.502858 | 2 |
zentral/contrib/monolith/forms.py | VegarM/zentral | 1 | 6624452 | import json
from django import forms
from django.db import IntegrityError, transaction
from django.db.models import F, Max, Q
from django.urls import reverse
from zentral.conf import settings
from zentral.contrib.inventory.models import MetaBusinessUnit, Tag
from zentral.utils.api_views import make_secret
from .attachm... | import json
from django import forms
from django.db import IntegrityError, transaction
from django.db.models import F, Max, Q
from django.urls import reverse
from zentral.conf import settings
from zentral.contrib.inventory.models import MetaBusinessUnit, Tag
from zentral.utils.api_views import make_secret
from .attachm... | en | 0.537616 | # 10 trials max #") # trash other versions # TODO: HARDCODED !!! # updated_at # updated_at # updated_at # updated_at # TODO: what if there is a ' in the json payload ? # DEPNotifiy release # hide manifest dropdown if manifest/mbu is fixed # the value will be set in the clean_manifest method # TODO: kind of a hack # mun... | 1.896889 | 2 |
MedTARSQI/src/main/resources/ttk/docmodel/metadata_parser.py | CDCgov/DCPC | 6 | 6624453 | """Metadata Parsers.
This module contains metadata parsers, that is, parsers that pull out the
metadata and add it to a TarsqiDocument. The only requirements on each parser is
that it defines an __init__() method that takes a dictionary of options and a
parse() method that takes a TarsqiDocument instance.
Current par... | """Metadata Parsers.
This module contains metadata parsers, that is, parsers that pull out the
metadata and add it to a TarsqiDocument. The only requirements on each parser is
that it defines an __init__() method that takes a dictionary of options and a
parse() method that takes a TarsqiDocument instance.
Current par... | en | 0.804198 | Metadata Parsers. This module contains metadata parsers, that is, parsers that pull out the metadata and add it to a TarsqiDocument. The only requirements on each parser is that it defines an __init__() method that takes a dictionary of options and a parse() method that takes a TarsqiDocument instance. Current parser... | 2.642568 | 3 |
tubify.py | teejaytiger/Tubify | 0 | 6624454 | from genericpath import exists
import os, subprocess, sys
from posixpath import splitext
import spotipy
import yaml
from spotipy.oauth2 import SpotifyOAuth
from youtube_search import YoutubeSearch
from difflib import SequenceMatcher
from subprocess import Popen, PIPE
## configuration
class config:
def __init__(s... | from genericpath import exists
import os, subprocess, sys
from posixpath import splitext
import spotipy
import yaml
from spotipy.oauth2 import SpotifyOAuth
from youtube_search import YoutubeSearch
from difflib import SequenceMatcher
from subprocess import Popen, PIPE
## configuration
class config:
def __init__(s... | en | 0.819105 | ## configuration ## import the config file as config properties # configure Spotipy # capture the top result for a song title # get the tracks of a specific spotify playlist by id # collect a users playlists #playlists = sp.user_playlists(username) # determine if the playlist is specified in the config file # only grab... | 2.640987 | 3 |
2020/Python/day03.py | SDragon42/AdventOfCode2019 | 0 | 6624455 | <reponame>SDragon42/AdventOfCode2019
from typing import List
import helper
import inputHelper
from puzzleBase import PuzzleBase
class InputData:
input: List[str]
slopes: List[str]
expectedAnswer: int
def __init__(self, name: str, part: int) -> None:
day = 3
self.input... | from typing import List
import helper
import inputHelper
from puzzleBase import PuzzleBase
class InputData:
input: List[str]
slopes: List[str]
expectedAnswer: int
def __init__(self, name: str, part: int) -> None:
day = 3
self.input = inputHelper.load_file(day, name).s... | zh | 0.425303 | #lines[0].split(',') | 3.747589 | 4 |
project/settings.py | kunugoda/jobbrd | 0 | 6624456 | <reponame>kunugoda/jobbrd
"""
Django settings for activcar project.
Generated by 'django-admin startproject' using Django 1.10.6.
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/r... | """
Django settings for activcar project.
Generated by 'django-admin startproject' using Django 1.10.6.
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/
"""
import o... | en | 0.62065 | Django settings for activcar project. Generated by 'django-admin startproject' using Django 1.10.6. 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/ # Build paths ins... | 1.79376 | 2 |
tests/gcp/hooks/test_cloud_build.py | suensummit/airflow | 1 | 6624457 | <gh_stars>1-10
# -*- coding: utf-8 -*-
#
# 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, Ver... | # -*- coding: utf-8 -*-
#
# 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
#... | en | 0.817941 | # -*- coding: utf-8 -*- # # 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 #... | 1.738491 | 2 |
jwql/utils/mast_utils.py | falkben/jwql | 42 | 6624458 | """Various utility functions for interacting with MAST
Authors
-------
- <NAME>
Use
---
This module can be imported as such:
>>> import mast_utils
results = mast_utils.mast_query('nircam', 'NRCA1_FULL', 'NRC_DARK', 53005.1, 53005.2)
"""
from jwql.jwql_monitors import monitor_mast
from jwql.utils... | """Various utility functions for interacting with MAST
Authors
-------
- <NAME>
Use
---
This module can be imported as such:
>>> import mast_utils
results = mast_utils.mast_query('nircam', 'NRCA1_FULL', 'NRC_DARK', 53005.1, 53005.2)
"""
from jwql.jwql_monitors import monitor_mast
from jwql.utils... | en | 0.624465 | Various utility functions for interacting with MAST Authors ------- - <NAME> Use --- This module can be imported as such: >>> import mast_utils results = mast_utils.mast_query('nircam', 'NRCA1_FULL', 'NRC_DARK', 53005.1, 53005.2) Use ``astroquery`` to search MAST for data for given observation ... | 2.715309 | 3 |
configs/nusc/pp/nusc_centerpoint_pp_02voxel_two_pfn_test.py | APVGITHUB/CenterPoint | 0 | 6624459 | import itertools
import logging
from importlib_metadata import version
from det3d.utils.config_tool import get_downsample_factor
tasks = [
dict(num_class=1, class_names=["car"]),
dict(num_class=2, class_names=["truck", "construction_vehicle"]),
dict(num_class=2, class_names=["bus", "trailer"]),
dict(... | import itertools
import logging
from importlib_metadata import version
from det3d.utils.config_tool import get_downsample_factor
tasks = [
dict(num_class=1, class_names=["car"]),
dict(num_class=2, class_names=["truck", "construction_vehicle"]),
dict(num_class=2, class_names=["bus", "trailer"]),
dict(... | en | 0.566061 | # training and testing settings # model settings # type='RPNHead', # (output_channel, num_conv) # dataset settings # optimizer # yapf:disable # dict(type='TensorboardLoggerHook') # yapf:enable # runtime settings | 1.752591 | 2 |
bin/funannotate-test.py | Ram-Nagar/funannotate | 1 | 6624460 | <gh_stars>1-10
#!/usr/bin/env python
import sys
import os
import subprocess
import urllib2
import socket
import argparse
import shutil
#setup menu with argparse
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(self,prog):
super(MyFormatter,self).__init__(prog,max_help_position=48)
p... | #!/usr/bin/env python
import sys
import os
import subprocess
import urllib2
import socket
import argparse
import shutil
#setup menu with argparse
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(self,prog):
super(MyFormatter,self).__init__(prog,max_help_position=48)
parser=argparse.... | de | 0.69622 | #!/usr/bin/env python #setup menu with argparse Script to download and then test funannotate installation Written by <NAME> (2016-2018) <EMAIL> ########################################################") ########################################################") #check that everything worked ############################... | 2.410385 | 2 |
scraper/spider/spiders/cmich.py | adaschevici/unicrawlers | 0 | 6624461 | <reponame>adaschevici/unicrawlers
# -*- coding: utf-8 -*-
import os
from twisted.internet import reactor, defer
from scrapy.selector import Selector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.spider import BaseSpider
from scrapy.http import Request
from scrapy import log
fro... | # -*- coding: utf-8 -*-
import os
from twisted.internet import reactor, defer
from scrapy.selector import Selector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.spider import BaseSpider
from scrapy.http import Request
from scrapy import log
from urllib import urlencode
from sp... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.170487 | 2 |
home/migrations/0005_delete_job.py | AkinWilderman/myPort | 0 | 6624462 | # Generated by Django 2.1.7 on 2019-07-05 23:09
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0004_auto_20190706_0004'),
]
operations = [
migrations.DeleteModel(
name='Job',
),
]
| # Generated by Django 2.1.7 on 2019-07-05 23:09
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0004_auto_20190706_0004'),
]
operations = [
migrations.DeleteModel(
name='Job',
),
]
| en | 0.702617 | # Generated by Django 2.1.7 on 2019-07-05 23:09 | 1.330764 | 1 |
examples/extensions/kmeans.py | NunoEdgarGFlowHub/cvxpy | 0 | 6624463 | """
Copyright 2013 <NAME>
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed in the ho... | """
Copyright 2013 <NAME>
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed in the ho... | en | 0.822247 | Copyright 2013 <NAME> This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed in the hope t... | 1.964874 | 2 |
ux/parser.py | baudo2048/uxlang | 0 | 6624464 | import sys
import os
import math
inFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/ux/"
outFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/"
scriptFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/script/"
def getTokenType(t):
sentinel = t[0]
if (sentinel == "."):
return "attr"
if (sentinel ==... | import sys
import os
import math
inFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/ux/"
outFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/"
scriptFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/script/"
def getTokenType(t):
sentinel = t[0]
if (sentinel == "."):
return "attr"
if (sentinel ==... | it | 0.515901 | # PRIMO PASSAGGIO ## Leggo il file la prima volta e sostituisco gli include e salvo in un file intermedio # Porto in testa gli importo che erano presenti nel file .script importato # t = tokens f = fileOut c = currentVarName ns = namespace # t = tokens f = fileOut c = currentVarName n = count # TRASFORM... | 2.817545 | 3 |
python/cudf/cudf/core/column/datetime.py | JohnZed/cudf | 0 | 6624465 | # Copyright (c) 2019-2020, NVIDIA CORPORATION.
import datetime as dt
import numpy as np
import pandas as pd
import pyarrow as pa
import cudf._lib as libcudf
from cudf._lib.nvtx import annotate
from cudf.core.buffer import Buffer
from cudf.core.column import column
from cudf.utils import utils
from cudf.utils.dtypes ... | # Copyright (c) 2019-2020, NVIDIA CORPORATION.
import datetime as dt
import numpy as np
import pandas as pd
import pyarrow as pa
import cudf._lib as libcudf
from cudf._lib.nvtx import annotate
from cudf.core.buffer import Buffer
from cudf.core.column import column
from cudf.utils import utils
from cudf.utils.dtypes ... | en | 0.626886 | # Copyright (c) 2019-2020, NVIDIA CORPORATION. # nanoseconds per time_unit Parameters ---------- data : Buffer The datetime values dtype : np.dtype The data type mask : Buffer; optional The validity mask # Handles improper item types Returns the defaul... | 2.665322 | 3 |
Lib/vanilla/vanillaBase.py | RafalBuchner/vanilla | 0 | 6624466 | <gh_stars>0
import platform
from distutils.version import StrictVersion
from Foundation import NSObject
from AppKit import NSFont, NSRegularControlSize, NSSmallControlSize, NSMiniControlSize, \
NSViewMinXMargin, NSViewMaxXMargin, NSViewMaxYMargin, NSViewMinYMargin, \
NSViewWidthSizable, NSViewHeightSizable, \
... | import platform
from distutils.version import StrictVersion
from Foundation import NSObject
from AppKit import NSFont, NSRegularControlSize, NSSmallControlSize, NSMiniControlSize, \
NSViewMinXMargin, NSViewMaxXMargin, NSViewMaxYMargin, NSViewMinYMargin, \
NSViewWidthSizable, NSViewHeightSizable, \
NSLayoutC... | en | 0.466715 | # -------------------- # OS Version Constants # -------------------- # macOS11 Big Sur seems to be 10.16 # --------- # Base View # --------- Enable or disable the object. *onOff* should be a boolean. Return a bool indicating if the object is visible or not. Show or hide the object. **onOff** A boolean value re... | 2.010521 | 2 |
evaluation/models.py | AymenQ/tarteel.io | 1 | 6624467 | from django.db import models
from django.forms import ModelForm
from restapi.models import AnnotatedRecording
class TajweedEvaluation(models.Model):
"""A model that contains the information we want to receive from the expert
regarding the data."""
# Degree Choices
MAJOR_DEGREE = 'jali'
MINOR_DEGRE... | from django.db import models
from django.forms import ModelForm
from restapi.models import AnnotatedRecording
class TajweedEvaluation(models.Model):
"""A model that contains the information we want to receive from the expert
regarding the data."""
# Degree Choices
MAJOR_DEGREE = 'jali'
MINOR_DEGRE... | en | 0.924843 | A model that contains the information we want to receive from the expert regarding the data. # Degree Choices # Category Choices # Link the rule evaluation with a specific recording | 2.603192 | 3 |
pymc/tests/test_smc.py | 5hv5hvnk/pymc | 0 | 6624468 | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.872629 | # Copyright 2020 The PyMC Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 1.908803 | 2 |
hblfit/data.py | Lachimax/hblfit | 0 | 6624469 | import astropy.table as table
import pkg_resources
def get_table(n: int):
stream = pkg_resources.resource_stream(__name__, f'data/table_{n}.csv')
return table.Table.read(stream, format="ascii.csv")
| import astropy.table as table
import pkg_resources
def get_table(n: int):
stream = pkg_resources.resource_stream(__name__, f'data/table_{n}.csv')
return table.Table.read(stream, format="ascii.csv")
| none | 1 | 2.434923 | 2 | |
scrutiny/javacard/toolwrappers/gppro.py | NimRo97/jcpeg | 2 | 6624470 | from abc import ABC
from typing import final
from overrides import overrides, EnforceOverrides
from scrutiny.config import Paths
from scrutiny.interfaces import ToolWrapper
from scrutiny.javacard.modules.atr import Atr
from scrutiny.javacard.modules.cplc import Cplc
from scrutiny.utils import execute_cmd, isfile
from... | from abc import ABC
from typing import final
from overrides import overrides, EnforceOverrides
from scrutiny.config import Paths
from scrutiny.interfaces import ToolWrapper
from scrutiny.javacard.modules.atr import Atr
from scrutiny.javacard.modules.cplc import Cplc
from scrutiny.utils import execute_cmd, isfile
from... | en | 0.487827 | SCRUTINY ToolWrapper for GlobalPlatformPro Wrapper for running GlobalPlatformPro SCRUTINY ToolWrapper for GlobalPlatformPro -info SCRUTINY ToolWrapper for GlobalPlatformPro -list | 2.674896 | 3 |
utils/experiment.py | ReddyLab/cegs-portal | 0 | 6624471 | import json
import os.path
from typing import IO, Any
from cegs_portal.search.models import Experiment, ExperimentDataFile
from .file import FileMetadata
from .misc import get_delimiter
class ExperimentDatafileMetadata:
description: str
cell_line: str
filename: str
ref_genome: str
ref_genome_pat... | import json
import os.path
from typing import IO, Any
from cegs_portal.search.models import Experiment, ExperimentDataFile
from .file import FileMetadata
from .misc import get_delimiter
class ExperimentDatafileMetadata:
description: str
cell_line: str
filename: str
ref_genome: str
ref_genome_pat... | none | 1 | 2.646439 | 3 | |
tests/clap.py | Vykstorm/mowaysim | 0 | 6624472 | <gh_stars>0
import sys, atexit
from time import sleep
from mowaysim import *
print 'Executing ' + __name__ + ' test...'
if __name__ == '__main__':
atexit.register(exit_mow)
channel = 8
moway.usbinit_moway()
ret = moway.init_moway(channel)
if ret == 0:
print 'Moway RFUSB Connected'
else:
print 'Moway ... | import sys, atexit
from time import sleep
from mowaysim import *
print 'Executing ' + __name__ + ' test...'
if __name__ == '__main__':
atexit.register(exit_mow)
channel = 8
moway.usbinit_moway()
ret = moway.init_moway(channel)
if ret == 0:
print 'Moway RFUSB Connected'
else:
print 'Moway RFUSB not co... | none | 1 | 2.363906 | 2 | |
_unittests/ut_dnotebooks/test_LONG_2A_notebook_cffi.py | mohamedelkansouli/Ensae_py | 0 | 6624473 | <filename>_unittests/ut_dnotebooks/test_LONG_2A_notebook_cffi.py
# -*- coding: utf-8 -*-
"""
@brief test log(time=180s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import add_missing_development_versio... | <filename>_unittests/ut_dnotebooks/test_LONG_2A_notebook_cffi.py
# -*- coding: utf-8 -*-
"""
@brief test log(time=180s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import add_missing_development_versio... | en | 0.800325 | # -*- coding: utf-8 -*- @brief test log(time=180s) | 2.087706 | 2 |
day05b.py | jjhelmus/adventofcode | 5 | 6624474 | from __future__ import print_function
def is_nice(string):
# repeats with exactly one letter between them
if not any([string[i] == string[i+2] for i in range(len(string)-2)]):
return False
# pair appears at least twice
if any([(string.count(string[i:i+2])>=2) for i in range(len(string)-2)]):... | from __future__ import print_function
def is_nice(string):
# repeats with exactly one letter between them
if not any([string[i] == string[i+2] for i in range(len(string)-2)]):
return False
# pair appears at least twice
if any([(string.count(string[i:i+2])>=2) for i in range(len(string)-2)]):... | en | 0.985873 | # repeats with exactly one letter between them # pair appears at least twice | 3.763869 | 4 |
tests/renderers/httpdomain/test_render_json_schema_description.py | nickswebsite/openapi | 0 | 6624475 | <reponame>nickswebsite/openapi<filename>tests/renderers/httpdomain/test_render_json_schema_description.py
"""OpenAPI spec renderer: render_json_schema_description."""
import textwrap
import pytest
from sphinxcontrib.openapi import renderers
def textify(generator):
return "\n".join(generator)
@pytest.mark.par... | """OpenAPI spec renderer: render_json_schema_description."""
import textwrap
import pytest
from sphinxcontrib.openapi import renderers
def textify(generator):
return "\n".join(generator)
@pytest.mark.parametrize(
["req_or_res", "directive", "typedirective"],
[
pytest.param("req", "reqjson", "... | en | 0.498391 | OpenAPI spec renderer: render_json_schema_description. JSON schema description is generated for JSON object in root. type: object properties: prop_a: type: string prop_b: type: object properties: ... | 2.253278 | 2 |
tests/components/test_alert.py | don66/home-assistant | 37 | 6624476 | <gh_stars>10-100
"""The tests for the Alert component."""
# pylint: disable=protected-access
from copy import deepcopy
import unittest
from homeassistant.setup import setup_component
from homeassistant.core import callback
import homeassistant.components.alert as alert
import homeassistant.components.notify as notify
... | """The tests for the Alert component."""
# pylint: disable=protected-access
from copy import deepcopy
import unittest
from homeassistant.setup import setup_component
from homeassistant.core import callback
import homeassistant.components.alert as alert
import homeassistant.components.notify as notify
from homeassistan... | en | 0.809073 | The tests for the Alert component. # pylint: disable=protected-access # pylint: disable=invalid-name Test the alert module. Setup things to be run when tests are started. Stop everything that was started. Test is_on method. Test setup method. Test the alert firing. Test silencing the alert. # alert should not be silenc... | 2.42639 | 2 |
samples/coco/coco.py | xman0810/Mask_RCNN | 0 | 6624477 | """
Mask R-CNN
Configurations and data loading code for MS COCO.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
... | """
Mask R-CNN
Configurations and data loading code for MS COCO.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
... | en | 0.659127 | Mask R-CNN Configurations and data loading code for MS COCO. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by <NAME> ------------------------------------------------------------ Usage: import the module (see Jupyter notebooks for examples), or run from th... | 2.262744 | 2 |
src/simple_tools/p4a_term.py | DVSR1966/par4all | 51 | 6624478 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Set ANSI Terminal Color and Attributes.
Originally found on http://code.activestate.com/recipes/574451.
'''
import os
# Set to True to disable module (coloring etc.).
disabled = False
esc = '%s[' % chr(27)
reset = '%s0m' % esc
format = '1;%dm'
fgoffset, bgoffset =... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Set ANSI Terminal Color and Attributes.
Originally found on http://code.activestate.com/recipes/574451.
'''
import os
# Set to True to disable module (coloring etc.).
disabled = False
esc = '%s[' % chr(27)
reset = '%s0m' % esc
format = '1;%dm'
fgoffset, bgoffset =... | en | 0.589847 | #!/usr/bin/env python # -*- coding: utf-8 -*- Set ANSI Terminal Color and Attributes. Originally found on http://code.activestate.com/recipes/574451. # Set to True to disable module (coloring etc.). "arg" is a string or None If "arg" is None : the terminal is reset to his default values. If "arg" is a string it... | 3.804882 | 4 |
docker/dstat/plugins/dstat_fan.py | hzy9819/GreenPlum_WooKongDB | 34 | 6624479 | ### Author: <NAME> <<EMAIL>>
class dstat_plugin(dstat):
"""
Fan speed in RPM (rotations per minute) as reported by ACPI.
"""
def __init__(self):
self.name = 'fan'
self.type = 'd'
self.width = 4
self.scale = 500
self.open('/proc/acpi/ibm/fan')
def vars(self)... | ### Author: <NAME> <<EMAIL>>
class dstat_plugin(dstat):
"""
Fan speed in RPM (rotations per minute) as reported by ACPI.
"""
def __init__(self):
self.name = 'fan'
self.type = 'd'
self.width = 4
self.scale = 500
self.open('/proc/acpi/ibm/fan')
def vars(self)... | en | 0.694383 | ### Author: <NAME> <<EMAIL>> Fan speed in RPM (rotations per minute) as reported by ACPI. # vim:ts=4:sw=4:et | 2.578612 | 3 |
mods-config/python/utils/config_compose.py | enckse/freeradius | 9 | 6624480 | <filename>mods-config/python/utils/config_compose.py
#!/usr/bin/python
"""composes the config from user definitions."""
import json
import argparse
import os
import users
import users.__config__
import wrapper
import importlib
import csv
# file indicators
IND_DELIM = "_"
USER_INDICATOR = "user" + IND_DELIM
VLAN_INDICA... | <filename>mods-config/python/utils/config_compose.py
#!/usr/bin/python
"""composes the config from user definitions."""
import json
import argparse
import os
import users
import users.__config__
import wrapper
import importlib
import csv
# file indicators
IND_DELIM = "_"
USER_INDICATOR = "user" + IND_DELIM
VLAN_INDICA... | en | 0.732484 | #!/usr/bin/python composes the config from user definitions. # file indicators configuration meta information. init the instance. password group validation(s). bypass management. user+mac combos. set attributes. verify meta data. indicate a vlan was used. VLAN to VLAN mappings. create a user definition. import the modu... | 2.715481 | 3 |
ch08/attention_seq2seq.py | hyesungKomet/deep-learning-from-scratch-2 | 775 | 6624481 | <reponame>hyesungKomet/deep-learning-from-scratch-2
# coding: utf-8
import sys
sys.path.append('..')
from common.time_layers import *
from ch07.seq2seq import Encoder, Seq2seq
from ch08.attention_layer import TimeAttention
class AttentionEncoder(Encoder):
def forward(self, xs):
xs = self.embed.forward(xs)... | # coding: utf-8
import sys
sys.path.append('..')
from common.time_layers import *
from ch07.seq2seq import Encoder, Seq2seq
from ch08.attention_layer import TimeAttention
class AttentionEncoder(Encoder):
def forward(self, xs):
xs = self.embed.forward(xs)
hs = self.lstm.forward(xs)
return h... | en | 0.833554 | # coding: utf-8 | 2.728901 | 3 |
datasets/fruits.py | YorkSu/hat | 1 | 6624482 | # pylint: disable=attribute-defined-outside-init
from hat.datasets.Dataset import Dataset
from hat.datasets.utils import DSBuilder
class fruits(Dataset):
"""
Fruits 数据集
"""
def args(self):
self._MISSION_LIST = ['classfication']
self.SHUFFLE = True
self.NUM_TRAIN = 58266
self.NUM_VAL = 19... | # pylint: disable=attribute-defined-outside-init
from hat.datasets.Dataset import Dataset
from hat.datasets.utils import DSBuilder
class fruits(Dataset):
"""
Fruits 数据集
"""
def args(self):
self._MISSION_LIST = ['classfication']
self.SHUFFLE = True
self.NUM_TRAIN = 58266
self.NUM_VAL = 19... | en | 0.270329 | # pylint: disable=attribute-defined-outside-init Fruits 数据集 # test part | 2.533804 | 3 |
tests/filters/test_uri.py | pabarros/asgard-api | 3 | 6624483 | <gh_stars>1-10
import unittest
from copy import copy
from hollowman.filters.uri import AddURIFilter
from hollowman.marathonapp import AsgardApp
from tests.utils import with_json_fixture
class AddURIFilterTest(unittest.TestCase):
@with_json_fixture("../fixtures/single_full_app.json")
def setUp(self, single_fu... | import unittest
from copy import copy
from hollowman.filters.uri import AddURIFilter
from hollowman.marathonapp import AsgardApp
from tests.utils import with_json_fixture
class AddURIFilterTest(unittest.TestCase):
@with_json_fixture("../fixtures/single_full_app.json")
def setUp(self, single_full_app_fixture)... | pt | 0.950721 | Não precisamos fazer o strip nos valores originais pois o Marathon já faz isso pra nós. Mesmo se a app já tiver utras uris, temos que adicionar a nossa Mesmo se a app já tiver utras uris, temos que adicionar a nossa | 2.343627 | 2 |
tester/test_handlers/test_static_handler.py | bukun/TorCMS | 243 | 6624484 | # -*- coding:utf-8 -*-
'''
Test
'''
from torcms.handlers.static_handler import StaticHandler
def test_zl():
'''
Test
'''
urls = [
("/label/(.*)", StaticHandler, {}),
]
assert urls
| # -*- coding:utf-8 -*-
'''
Test
'''
from torcms.handlers.static_handler import StaticHandler
def test_zl():
'''
Test
'''
urls = [
("/label/(.*)", StaticHandler, {}),
]
assert urls
| en | 0.640147 | # -*- coding:utf-8 -*- Test Test | 1.834207 | 2 |
flowws/internal.py | gitter-badger/flowws | 0 | 6624485 | <reponame>gitter-badger/flowws<filename>flowws/internal.py
import importlib
import logging
logger = logging.getLogger(__name__)
class FailedImport:
"""Module that failed to import."""
def __init__(self, exception):
self.exception = exception
def __getattr__(self, *args, **kwargs):
return... | import importlib
import logging
logger = logging.getLogger(__name__)
class FailedImport:
"""Module that failed to import."""
def __init__(self, exception):
self.exception = exception
def __getattr__(self, *args, **kwargs):
return self
def __call__(self, *args, **kwargs):
rais... | en | 0.785047 | Module that failed to import. Import an attribute from a module, or return an error-producing fake. This method is provided as a convenience for libraries that want to easily expose modules with a variety of prerequisite libraries without forcing the user to install prerequisites for the modules they d... | 3.415144 | 3 |
intro-python/parsing-json/nested_data.py | sandhjos/dne-dna-code | 0 | 6624486 | #!/usr/bin/env python
"""Working with nested data hands-on exercise / coding challenge."""
import json
import os
# Get the absolute path for the directory where this file is located "here"
from pprint import pprint
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "interfaces.json")) as... | #!/usr/bin/env python
"""Working with nested data hands-on exercise / coding challenge."""
import json
import os
# Get the absolute path for the directory where this file is located "here"
from pprint import pprint
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "interfaces.json")) as... | en | 0.822053 | #!/usr/bin/env python Working with nested data hands-on exercise / coding challenge. # Get the absolute path for the directory where this file is located "here" # TODO: Parse the contents of the JSON file into a variable # TODO: Loop through the interfaces in the JSON data and print out each # interface's name, ip, and... | 3.367939 | 3 |
ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py | fangxingli/mambari | 0 | 6624487 | #!/usr/bin/env python
'''
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")... | #!/usr/bin/env python
'''
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")... | en | 0.815619 | #!/usr/bin/env python 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... | 1.78063 | 2 |
Data Science With Python/07-cleaning-data-in-python/4-cleaning-data-for-analysis/06-custom-functions-to-clean-data.py | aimanahmedmoin1997/DataCamp | 5 | 6624488 | <filename>Data Science With Python/07-cleaning-data-in-python/4-cleaning-data-for-analysis/06-custom-functions-to-clean-data.py
'''
Custom functions to clean data
You'll now practice writing functions to clean data.
The tips dataset has been pre-loaded into a DataFrame called tips. It has a 'sex' column that contains... | <filename>Data Science With Python/07-cleaning-data-in-python/4-cleaning-data-for-analysis/06-custom-functions-to-clean-data.py
'''
Custom functions to clean data
You'll now practice writing functions to clean data.
The tips dataset has been pre-loaded into a DataFrame called tips. It has a 'sex' column that contains... | en | 0.77672 | Custom functions to clean data You'll now practice writing functions to clean data. The tips dataset has been pre-loaded into a DataFrame called tips. It has a 'sex' column that contains the values 'Male' or 'Female'. Your job is to write a function that will recode 'Male' to 1, 'Female' to 0, and return np.nan for a... | 4.261292 | 4 |
LCOF/21-30/22/22.py | xuychen/Leetcode | 0 | 6624489 | <reponame>xuychen/Leetcode
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def getKthFromEnd(self, head, k):
"""
:type head: ListNode
:type k: int
:rtype: ListNode
... | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def getKthFromEnd(self, head, k):
"""
:type head: ListNode
:type k: int
:rtype: ListNode
"""
stack =... | en | 0.41379 | # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None :type head: ListNode :type k: int :rtype: ListNode :type head: ListNode :type k: int :rtype: ListNode | 3.724325 | 4 |
examples/FlexibleSwingingPendulumCase/flexible_swinging_pendulum.py | L5vD5/PyElastica | 0 | 6624490 | """ Flexible swinging pendulum test-case
isort:skip_file
"""
# FIXME without appending sys.path make it more generic
import sys
sys.path.append("../../") # isort:skip
# from collections import defaultdict
# import numpy as np
from matplotlib import pyplot as plt
from elastica import *
class SwingingFlexibleP... | """ Flexible swinging pendulum test-case
isort:skip_file
"""
# FIXME without appending sys.path make it more generic
import sys
sys.path.append("../../") # isort:skip
# from collections import defaultdict
# import numpy as np
from matplotlib import pyplot as plt
from elastica import *
class SwingingFlexibleP... | en | 0.567295 | Flexible swinging pendulum test-case isort:skip_file # FIXME without appending sys.path make it more generic # isort:skip # from collections import defaultdict # import numpy as np # Options # For 10 elements, the prefac is 0.0007 # setting up test params # For shear modulus of 1e4, nu is 99! # Bad name : whats a ... | 2.568344 | 3 |
Leetcode/0354. Russian Doll Envelopes/0354.py | Next-Gen-UI/Code-Dynamics | 0 | 6624491 | <filename>Leetcode/0354. Russian Doll Envelopes/0354.py
class Solution:
def maxEnvelopes(self, envelopes: List[List[int]]) -> int:
envelopes.sort(key=lambda x: (x[0], -x[1]))
# same as 300. Longest Increasing Subsequence
ans = 0
dp = [0] * len(envelopes)
for _, h in envelopes:
l = 0
r... | <filename>Leetcode/0354. Russian Doll Envelopes/0354.py
class Solution:
def maxEnvelopes(self, envelopes: List[List[int]]) -> int:
envelopes.sort(key=lambda x: (x[0], -x[1]))
# same as 300. Longest Increasing Subsequence
ans = 0
dp = [0] * len(envelopes)
for _, h in envelopes:
l = 0
r... | en | 0.958281 | # same as 300. Longest Increasing Subsequence | 3.284009 | 3 |
maskrcnn_benchmark/utils/metric_logger.py | chenzhutian/auto-infog-timeline | 10 | 6624492 | <filename>maskrcnn_benchmark/utils/metric_logger.py<gh_stars>1-10
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from collections import defaultdict
from collections import deque
import torch
class SmoothedValue(object):
"""Track a series of values and provide access to smoothed values o... | <filename>maskrcnn_benchmark/utils/metric_logger.py<gh_stars>1-10
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from collections import defaultdict
from collections import deque
import torch
class SmoothedValue(object):
"""Track a series of values and provide access to smoothed values o... | en | 0.865088 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. Track a series of values and provide access to smoothed values over a window or the global series average. | 2.215059 | 2 |
UI/ControlRigUI.py | jazzboysc/SERiggingTools | 4 | 6624493 | <filename>UI/ControlRigUI.py
import maya.OpenMayaMPx as OpenMayaMPx
import maya.OpenMaya as OpenMaya
import maya.OpenMayaAnim as OpenMayaAnim
import maya.mel
import sys
import maya.cmds as cmds
import maya.OpenMayaUI as mui
from PySide2 import QtCore, QtGui, QtWidgets , QtUiTools
import shiboken2
import os
import time
... | <filename>UI/ControlRigUI.py
import maya.OpenMayaMPx as OpenMayaMPx
import maya.OpenMaya as OpenMaya
import maya.OpenMayaAnim as OpenMayaAnim
import maya.mel
import sys
import maya.cmds as cmds
import maya.OpenMayaUI as mui
from PySide2 import QtCore, QtGui, QtWidgets , QtUiTools
import shiboken2
import os
import time
... | en | 0.30625 | #"E:/Users/admin/Documents/GitHub/SERiggingTools/UI/LoadRiggingUI.ui" todo: stop open more than one window #QtCore.QResource.addSearchPath("E:/Users/admin/Documents/GitHub/SERiggingTools/UI") #QtCore.QResource.registerResource("E:/Users/admin/Documents/GitHub/SERiggingTools/UI/UIResource.qrc") {(u'RS_Center', u'RT_Glob... | 2.040735 | 2 |
karbor/common/notification.py | thisismsreddy/karbor | 0 | 6624494 | # 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.836366 | # 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.860254 | 2 |
LoggerK.py | FabioChiodini/LoggerK | 0 | 6624495 | import logging
import logstash
import os
import sys
import socket
import time
if 'LOG_HOST' not in os.environ:
raise(Exception("LOG_HOST NOT DEFINED"))
host = os.environ['LOG_HOST']
test_logger = logging.getLogger('python-logstash-logger')
test_logger.setLevel(logging.INFO)
test_logger.addHandler(logstash.Logs... | import logging
import logstash
import os
import sys
import socket
import time
if 'LOG_HOST' not in os.environ:
raise(Exception("LOG_HOST NOT DEFINED"))
host = os.environ['LOG_HOST']
test_logger = logging.getLogger('python-logstash-logger')
test_logger.setLevel(logging.INFO)
test_logger.addHandler(logstash.Logs... | en | 0.33552 | # test_logger.addHandler(logstash.TCPLogstashHandler(host, 5000, version=1)) # add extra field to logstash message # Code executed here #print j | 2.346286 | 2 |
src/dash/services.py | zenly/visibility | 4 | 6624496 | '''
Copyright 2013 <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 2013 <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.837625 | Copyright 2013 <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, softw... | 2.221939 | 2 |
interlib/run.py | D-Programming-Man/Pseudo | 0 | 6624497 | <reponame>D-Programming-Man/Pseudo
from interlib.utility import print_line
help_manual = " Note: \n" \
" You must define a function first with the \"Define\" keyword to use this keyword \n" \
" The syntax is very similar to the \"Define\" keyword \n" \
" Make sure this sta... | from interlib.utility import print_line
help_manual = " Note: \n" \
" You must define a function first with the \"Define\" keyword to use this keyword \n" \
" The syntax is very similar to the \"Define\" keyword \n" \
" Make sure this statement doesn't end with a colon (:)... | en | 0.872802 | Handler that allows running of functions Requires: . line_numb = The line number we are looking at in the Pseudo code file . line_list = The line we took from the Pseudo code file, but in list format . all_variables = The dictionary that contains all of the variables for that Psudo code file . indent = The indenta... | 4.159113 | 4 |
src/pretix/base/services/quotas.py | bhaettasch/pretix | 0 | 6624498 | import sys
from collections import Counter, defaultdict
from datetime import timedelta
from itertools import zip_longest
from django.conf import settings
from django.db import OperationalError, models
from django.db.models import (
Case, Count, F, Func, Max, OuterRef, Q, Subquery, Sum, Value, When,
)
from django.d... | import sys
from collections import Counter, defaultdict
from datetime import timedelta
from itertools import zip_longest
from django.conf import settings
from django.db import OperationalError, models
from django.db.models import (
Case, Count, F, Func, Max, OuterRef, Q, Subquery, Sum, Value, When,
)
from django.d... | en | 0.906071 | This special object allows so compute the availability of multiple quotas, even across events, and inspect their results. The maximum number of SQL queries is constant and not dependent on the number of quotas. Usage example:: qa = QuotaAvailability() qa.queue(quota1, quota2, …) qa.com... | 2.055242 | 2 |
gamesrc/food.py | Adi-UA/AI-Plays-Snake | 4 | 6624499 | <gh_stars>1-10
import pygame
class Food:
"""
This class represents a food object in the snake game.
"""
def __init__(self, grid, x, y):
"""
This function instantiates the Food object.
Arguments:
grid {Grid} -- The on which this food item is to be placed.
... | import pygame
class Food:
"""
This class represents a food object in the snake game.
"""
def __init__(self, grid, x, y):
"""
This function instantiates the Food object.
Arguments:
grid {Grid} -- The on which this food item is to be placed.
x {int} -- X... | en | 0.839864 | This class represents a food object in the snake game. This function instantiates the Food object. Arguments: grid {Grid} -- The on which this food item is to be placed. x {int} -- X coordinate in the standard coordinate system y {int} -- Y coordinate in the standard coordin... | 3.997263 | 4 |
cm/services/data/transient_storage.py | adrianppg/cloudman | 0 | 6624500 | <reponame>adrianppg/cloudman
"""
A wrapper class around instance's transient storage. This class exposes that
storage over NFS to the rest of the cluster.
.. important::
The file system behind this device is transient, meaning that it will
dissapear at instance termination and it cannot be recovered.
"""
impor... | """
A wrapper class around instance's transient storage. This class exposes that
storage over NFS to the rest of the cluster.
.. important::
The file system behind this device is transient, meaning that it will
dissapear at instance termination and it cannot be recovered.
"""
import commands
import grp
import ... | en | 0.836511 | A wrapper class around instance's transient storage. This class exposes that storage over NFS to the rest of the cluster. .. important:: The file system behind this device is transient, meaning that it will dissapear at instance termination and it cannot be recovered. Instance's transient storage exposed over ... | 2.585368 | 3 |
html_parsing/pravicon_com__s/upload_to_modx.py | DazEB2/SimplePyScripts | 117 | 6624501 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import json
import time
import traceback
# pip install selenium
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from config import DIR_DUMP, URL_MODIX_BASE, URL_MODIX_CREATE, LOGIN, PASSW... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import json
import time
import traceback
# pip install selenium
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from config import DIR_DUMP, URL_MODIX_BASE, URL_MODIX_CREATE, LOGIN, PASSWORD
from main impor... | ru | 0.324161 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # pip install selenium # options.add_argument('--headless') # Папки с сортировкой по имени # Тип содержимого JSON # driver.find_element_by_css_selector('[name=content_type]').get_attribute() # JSON # driver.quit() | 2.393347 | 2 |
tests/formatters/test_results.py | washingtonpost/elex-clarity | 9 | 6624502 | <gh_stars>1-10
from elexclarity.formatters.results import ClarityDetailXMLConverter
def test_georgia_precinct_formatting_basic(atkinson_precincts, ga_county_mapping_fips):
results = ClarityDetailXMLConverter("GA", county_lookup=ga_county_mapping_fips).convert(
atkinson_precincts,
level="precinct"
... | from elexclarity.formatters.results import ClarityDetailXMLConverter
def test_georgia_precinct_formatting_basic(atkinson_precincts, ga_county_mapping_fips):
results = ClarityDetailXMLConverter("GA", county_lookup=ga_county_mapping_fips).convert(
atkinson_precincts,
level="precinct"
)
asse... | en | 0.852287 | # Top level counts for this county # Pearson City precinct # Willacoochee precinct # Pearson City precinct # Willacoochee precinct Gwinnett has some special contest names so this test makes sure that those get mapped to the right office IDs # President # Loeffler # Perdue # County-level counts | 2.616725 | 3 |
benchmarks/ltl_timed_automata/fischer/f3/fischer_0010.py | EnricoMagnago/F3 | 3 | 6624503 | <filename>benchmarks/ltl_timed_automata/fischer/f3/fischer_0010.py
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_rational_type, msat_get_integer_type, \
msat_get_bool_typ... | <filename>benchmarks/ltl_timed_automata/fischer/f3/fischer_0010.py
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_rational_type, msat_get_integer_type, \
msat_get_bool_typ... | en | 0.457951 | # bound id # bound turn # delta > 0 -> id' = id & turn' = turn # (G F P0.location = wait) -> (G F P0.location = cs) Synchronous component Process module # int_type = msat_get_integer_type(menv) # loc, x_loc = self._symb("l", int_type) # l = idle & x = 0 # bound l # invars # bound l # invars # (l = idle) -> l' = req & ... | 2.420731 | 2 |
token_management_system/token_manager/models.py | pawanvirsingh/token_management | 0 | 6624504 | from datetime import datetime
from dateutil.relativedelta import relativedelta
import uuid
from django.db import models
from django.db.models import CASCADE
class BaseModel(models.Model):
id = models.UUIDField(primary_key=True, verbose_name='id', default=uuid.uuid4, editable=False)
created = models.DateTimeF... | from datetime import datetime
from dateutil.relativedelta import relativedelta
import uuid
from django.db import models
from django.db.models import CASCADE
class BaseModel(models.Model):
id = models.UUIDField(primary_key=True, verbose_name='id', default=uuid.uuid4, editable=False)
created = models.DateTimeF... | none | 1 | 2.10592 | 2 | |
pyscope/submission.py | clusterhack/python-autograde | 1 | 6624505 | <reponame>clusterhack/python-autograde<filename>pyscope/submission.py
# (c) 2022- <NAME> <<EMAIL>>
#
# This file is released under the MIT License:
# https://opensource.org/licenses/MIT
# This software is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied.
import shutil
from ... | # (c) 2022- <NAME> <<EMAIL>>
#
# This file is released under the MIT License:
# https://opensource.org/licenses/MIT
# This software is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied.
import shutil
from typing import Dict, List, Literal, Optional, Tuple, Union
import zipfi... | en | 0.864061 | # (c) 2022- <NAME> <<EMAIL>> # # This file is released under the MIT License: # https://opensource.org/licenses/MIT # This software is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. # TODO Add some msg logging facility (that gets included in Gradescope's result.json) # As... | 2.280663 | 2 |
adv/marth.py | pfleg/dl | 0 | 6624506 | from core.advbase import *
from slot.d import *
from slot.a import *
def module():
return Marth
class Marth(Adv):
comment = 'last boost once at start (team DPS not considered)'
a1 = ('prep',100)
a3 = ('cc',0.13,'hit10')
conf = {}
conf['slots.a'] = The_Shining_Overlord()+Me_and_My_Bestie(... | from core.advbase import *
from slot.d import *
from slot.a import *
def module():
return Marth
class Marth(Adv):
comment = 'last boost once at start (team DPS not considered)'
a1 = ('prep',100)
a3 = ('cc',0.13,'hit10')
conf = {}
conf['slots.a'] = The_Shining_Overlord()+Me_and_My_Bestie(... | en | 0.155663 | `dragon.act('c3 s s end'),s=2 `s3, not self.s3_buff `s2, self.afflics.burn.get() `s1, fsc `s4, fsc `fs, x=3 | 2.113624 | 2 |
chapter01/00/code_test.py | riseshia/nlp-100-knock | 0 | 6624507 | <gh_stars>0
import unittest
from code import reverse
class CodeTest(unittest.TestCase):
def test_reverse(self):
self.assertEqual('desserts',
reverse('stressed'))
if __name__ == '__main__':
unittest.main()
| import unittest
from code import reverse
class CodeTest(unittest.TestCase):
def test_reverse(self):
self.assertEqual('desserts',
reverse('stressed'))
if __name__ == '__main__':
unittest.main() | none | 1 | 3.249941 | 3 | |
happy_adventure/pygame_api/pysurface.py | vieirafrancisco/happy-adventure | 3 | 6624508 | <filename>happy_adventure/pygame_api/pysurface.py
import pygame
from pygame import Surface,surfarray
from .pyevent import Events
class Canvas(Surface,Events):
def __init__(self, master = None, surface = None, **surf_kwargs):
self.children = []
if not surface:
self._build_surface(*... | <filename>happy_adventure/pygame_api/pysurface.py
import pygame
from pygame import Surface,surfarray
from .pyevent import Events
class Canvas(Surface,Events):
def __init__(self, master = None, surface = None, **surf_kwargs):
self.children = []
if not surface:
self._build_surface(*... | none | 1 | 2.777438 | 3 | |
src/download_json.py | aws-samples/amazon-sagemaker-predict-accessibility | 12 | 6624509 | import sys
from datetime import date
import requests
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from pyspark.sql.functions import col, expr, when, round
from pyspark.sql.types ... | import sys
from datetime import date
import requests
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
from pyspark.sql.functions import col, expr, when, round
from pyspark.sql.types ... | en | 0.673372 | # replace with your userid here ## replace with your userid here | 2.366992 | 2 |
office__excel__openpyxl__xlwt/hidden_columns.py | DazEB2/SimplePyScripts | 117 | 6624510 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: http://openpyxl.readthedocs.io/en/stable/usage.html#fold-columns-outline
import openpyxl
wb = openpyxl.Workbook()
ws = wb.get_active_sheet()
ws.column_dimensions.group('B', 'D', hidden=True)
wb.save('excel.xlsx')
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: http://openpyxl.readthedocs.io/en/stable/usage.html#fold-columns-outline
import openpyxl
wb = openpyxl.Workbook()
ws = wb.get_active_sheet()
ws.column_dimensions.group('B', 'D', hidden=True)
wb.save('excel.xlsx')
| en | 0.34604 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # SOURCE: http://openpyxl.readthedocs.io/en/stable/usage.html#fold-columns-outline | 2.569902 | 3 |
parser/fase2/team12/src/Start/Start.py | Gabriel-15/tytus | 35 | 6624511 | import sys, os.path
import json
nodo_dir = (os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + '\\Start\\')
sys.path.append(nodo_dir)
c3d_dir = (os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + '\\C3D\\')
sys.path.append(c3d_dir)
nodo_dir = (os.path.abspath(os.path.join(os.path.dirname(_... | import sys, os.path
import json
nodo_dir = (os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + '\\Start\\')
sys.path.append(nodo_dir)
c3d_dir = (os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + '\\C3D\\')
sys.path.append(c3d_dir)
nodo_dir = (os.path.abspath(os.path.join(os.path.dirname(_... | es | 0.834053 | # Importación de Clases para Execute # recursiva por la izquierda #entornoGlobal.recorrerEntorno() # Recibe un json #region Declaracion de Variables Execute (SQL) #endregion #region Recorrido para la sentencia Function #endregion #region Declaracion de las variables #listaInstrucciones.append("\tprint(display[p])") #en... | 2.127127 | 2 |
electrumfairchains/network.py | TonyFord/electrumfairchains | 1 | 6624512 | <gh_stars>1-10
# Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 <NAME>
#
# 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 t... | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to us... | en | 0.779847 | # Electrum - Lightweight Bitcoin Client # Copyright (c) 2011-2016 <NAME> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to us... | 1.454109 | 1 |
auth.py | girish97115/anonymail | 0 | 6624513 | <reponame>girish97115/anonymail
import functools
from flask import (Blueprint, flash, g, redirect, render_template, request, session, url_for, current_app)
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.exceptions import abort
import smtplib,time
from itsdangerous import URLSaf... | import functools
from flask import (Blueprint, flash, g, redirect, render_template, request, session, url_for, current_app)
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.exceptions import abort
import smtplib,time
from itsdangerous import URLSafeTimedSerializer
from anonymail.... | en | 0.532095 | #Retrieving Gmail credentials | 2.220839 | 2 |
phyton/Exercicio021_Musica_ pygame.py | felipebaloneker/Practice | 0 | 6624514 | <reponame>felipebaloneker/Practice
import pygame
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load('song021.mp3')
pygame.mixer.music.play()
pygame.event.wait()
| import pygame
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load('song021.mp3')
pygame.mixer.music.play()
pygame.event.wait() | none | 1 | 2.179234 | 2 | |
code/dependency/prepare_norm_data.py | adapt-sjtu/commonsense-locatednear | 1 | 6624515 | import os
import networkx as nx
import sys
from pycorenlp import StanfordCoreNLP
from pprint import pprint
import json
subdir = sys.argv[1]
port = sys.argv[2]
nlp = StanfordCoreNLP('http://localhost:{0}'.format(port))
def get_vocab_dic_split(filename):
with open(filename) as inf:
vocab ... | import os
import networkx as nx
import sys
from pycorenlp import StanfordCoreNLP
from pprint import pprint
import json
subdir = sys.argv[1]
port = sys.argv[2]
nlp = StanfordCoreNLP('http://localhost:{0}'.format(port))
def get_vocab_dic_split(filename):
with open(filename) as inf:
vocab ... | en | 0.859561 | # The code expects the document to contains exactly one sentence. # document = 'The men, crowded upon each other, stared stupidly like a flock of sheep.' # print('document: {0}'.format(document)) # Parse the text # Load Stanford CoreNLP's dependency tree into a networkx graph # Find the shortest path # print(token1) # ... | 2.608255 | 3 |
preprocessing_add_features.py | mr-cloud/tollgate | 0 | 6624516 | import numpy as np
import os
import time
import pandas as pd
holidays = {
'moon': {
'begin': time.strptime('2016-09-15', '%Y-%m-%d'),
'end': time.strptime('2016-09-17 23:59:59', '%Y-%m-%d %H:%M:%S')
},
'national': {
'begin': time.strptime('2016-10-01', '%Y-%m-%d'),
'end': t... | import numpy as np
import os
import time
import pandas as pd
holidays = {
'moon': {
'begin': time.strptime('2016-09-15', '%Y-%m-%d'),
'end': time.strptime('2016-09-17 23:59:59', '%Y-%m-%d %H:%M:%S')
},
'national': {
'begin': time.strptime('2016-10-01', '%Y-%m-%d'),
'end': t... | en | 0.781732 | # features: <route_quality, # wind_direction, wind_speed, temperature, precipitation, # weekend, time_of_day> # calculate the route's quality. # quality = length / (width * lanes) # features: <tollgate_scale, # wind_direction, wind_speed, temperature, precipitation, # weekend, ti... | 2.638321 | 3 |
tccli/services/gaap/gaap_client.py | ws0416/tencentcloud-cli-intl-en | 0 | 6624517 | <reponame>ws0416/tencentcloud-cli-intl-en<filename>tccli/services/gaap/gaap_client.py
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import Configurati... | # -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.ht... | en | 0.62608 | # -*- coding: utf-8 -*- # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python3.3 # python... | 1.749657 | 2 |
server/models/event_category.py | Synergize-Southwest-Detroit/api | 0 | 6624518 | <gh_stars>0
from server.models.db import db
class EventCategory(db.Model):
__tablename__ = 'event_categories'
category_id = db.Column('category_id', db.Integer, db.ForeignKey('categories.id'), primary_key=True)
event_id = db.Column('event_id', db.Integer, db.ForeignKey('events.id'), primary_key=True)
... | from server.models.db import db
class EventCategory(db.Model):
__tablename__ = 'event_categories'
category_id = db.Column('category_id', db.Integer, db.ForeignKey('categories.id'), primary_key=True)
event_id = db.Column('event_id', db.Integer, db.ForeignKey('events.id'), primary_key=True)
event = db.... | none | 1 | 2.435905 | 2 | |
nova/tests/api/ec2/test_cloud.py | SnabbCo/nova | 2 | 6624519 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | en | 0.842501 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License");... | 1.083352 | 1 |
uamqp/async/mgmt_operation_async.py | gdooper/azure-uamqp-python | 0 | 6624520 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import logg... | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import logg... | en | 0.788862 | #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- #from uamqp.... | 2.007431 | 2 |
django_swiss_knife/buttons.py | sthima/django-swiss-knife | 2 | 6624521 | from django.forms.utils import flatatt
from django.utils.safestring import mark_safe
from django.template import loader
class AbstractButton(object):
def __init__(self, url, label, attrs={}):
self.url = url
self.label = label
self.attrs = attrs
def __call__(self):
return self... | from django.forms.utils import flatatt
from django.utils.safestring import mark_safe
from django.template import loader
class AbstractButton(object):
def __init__(self, url, label, attrs={}):
self.url = url
self.label = label
self.attrs = attrs
def __call__(self):
return self... | en | 0.674283 | A dropdown button that display a all buttons passed on actions A button splitted into action and dropdown | 2.344777 | 2 |
tensorflow/examples/saved_model/integration_tests/use_rnn_cell.py | abhaikollara/tensorflow | 848 | 6624522 | # Copyright 2019 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... | # Copyright 2019 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... | en | 0.847951 | # Copyright 2019 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... | 2.073374 | 2 |
AlienIvansion/bullet.py | FranciscoCabrita1/Cabrita | 5 | 6624523 | import pygame
from pygame.sprite import Sprite
class Bullet(Sprite):
"""Uma classe que administra projéteis disparados pela espaçonave."""
def __init__(self, ai_settings, screen, ship):
"""Cria um objeto para o projétil na posição atual da espaçonave."""
super(Bullet, self).__init__()
... | import pygame
from pygame.sprite import Sprite
class Bullet(Sprite):
"""Uma classe que administra projéteis disparados pela espaçonave."""
def __init__(self, ai_settings, screen, ship):
"""Cria um objeto para o projétil na posição atual da espaçonave."""
super(Bullet, self).__init__()
... | pt | 0.988748 | Uma classe que administra projéteis disparados pela espaçonave. Cria um objeto para o projétil na posição atual da espaçonave. # Cria um retângulo para o projétil em (0,0) e, em seguida, define a posição correta # Armazena a posição do projétil como um valor decimal Move o projétil para cima na tela. # Atualiza a posiç... | 3.926651 | 4 |
examples/__init__.py | musicinmybrain/ppft | 53 | 6624524 | #!/usr/bin/env python
#
# Author: <NAME> (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2018-2021 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/ppft/blob/master/LICENSE
"""
to run this test suite, first build and i... | #!/usr/bin/env python
#
# Author: <NAME> (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2018-2021 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/ppft/blob/master/LICENSE
"""
to run this test suite, first build and i... | en | 0.607003 | #!/usr/bin/env python # # Author: <NAME> (mmckerns @caltech and @uqfoundation) # Copyright (c) 2018-2021 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - https://github.com/uqfoundation/ppft/blob/master/LICENSE to run this test suite, first build and insta... | 1.379166 | 1 |
skfem/element/discrete_field.py | ahhuhtal/scikit-fem | 1 | 6624525 | from typing import NamedTuple, Optional
import numpy as np
from numpy import ndarray
class DiscreteField(NamedTuple):
"""A function defined at the global quadrature points."""
value: Optional[ndarray] = None
grad: Optional[ndarray] = None
div: Optional[ndarray] = None
curl: Optional[ndarray] = N... | from typing import NamedTuple, Optional
import numpy as np
from numpy import ndarray
class DiscreteField(NamedTuple):
"""A function defined at the global quadrature points."""
value: Optional[ndarray] = None
grad: Optional[ndarray] = None
div: Optional[ndarray] = None
curl: Optional[ndarray] = N... | en | 0.842514 | A function defined at the global quadrature points. For backwards compatibility; used by old style form decorators. For backwards compatibility; used by old style form decorators. For backwards compatibility; used by old style form decorators. Split all components based on their first dimension. Return zero :class:`~sk... | 3.291492 | 3 |
modified_porechop/nanopore_read.py | shelkmike/Modified_porechop | 1 | 6624526 | #!/usr/bin/env python3
"""
Copyright 2017 <NAME> (<EMAIL>)
https://github.com/rrwick/Porechop
This module contains the class for a Nanopore read.
This file is part of Porechop. Porechop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Fre... | #!/usr/bin/env python3
"""
Copyright 2017 <NAME> (<EMAIL>)
https://github.com/rrwick/Porechop
This module contains the class for a Nanopore read.
This file is part of Porechop. Porechop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the Fre... | en | 0.905585 | #!/usr/bin/env python3 Copyright 2017 <NAME> (<EMAIL>) https://github.com/rrwick/Porechop This module contains the class for a Nanopore read. This file is part of Porechop. Porechop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free So... | 2.859536 | 3 |
resolwe_bio/processes/import_data/methylation_array_idat.py | romunov/resolwe-bio | 12 | 6624527 | """Upload methylation array data (IDAT)."""
from resolwe.process import FileField, Process, SchedulingClass, StringField
def validate_filename_suffix(filename, suffix, resolwe_process=Process):
"""Raise an error if unexpected file name suffix is encountered."""
try:
assert filename.endswith(suffix)
... | """Upload methylation array data (IDAT)."""
from resolwe.process import FileField, Process, SchedulingClass, StringField
def validate_filename_suffix(filename, suffix, resolwe_process=Process):
"""Raise an error if unexpected file name suffix is encountered."""
try:
assert filename.endswith(suffix)
... | en | 0.706634 | Upload methylation array data (IDAT). Raise an error if unexpected file name suffix is encountered. Upload Illumina methylation array raw IDAT data. This import process accepts Illumina methylation array BeadChip raw files in IDAT format. Two input files, one for each of the Green and Red signal channels, ... | 2.493422 | 2 |
precompiler/_version/pc_version.py | raxvan/precompiler | 6 | 6624528 | <filename>precompiler/_version/pc_version.py
_PCVER_HIGH_ = 0
_PCVER_LOW0_ = 1
_PCVER_LOW1_ = 6
| <filename>precompiler/_version/pc_version.py
_PCVER_HIGH_ = 0
_PCVER_LOW0_ = 1
_PCVER_LOW1_ = 6
| none | 1 | 1.194167 | 1 | |
trove/db/sqlalchemy/migrate_repo/versions/012_backup.py | zhujzhuo/openstack-trove | 1 | 6624529 | #Copyright [2013] Hewlett-Packard Development Company, L.P.
#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... | #Copyright [2013] Hewlett-Packard Development Company, L.P.
#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... | en | 0.834911 | #Copyright [2013] Hewlett-Packard Development Company, L.P. #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # #http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or ag... | 1.763495 | 2 |
core/NetworkFactory.py | CVLAB-Unibo/ATDT | 16 | 6624530 | <reponame>CVLAB-Unibo/ATDT
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from core.ops import *
from core.models import *
from core.input import *
from core.losses import *
from utils.utils import *
def factory(inputs, params,reuse_variables=False):
if params.task=='semantic':... | import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from core.ops import *
from core.models import *
from core.input import *
from core.losses import *
from utils.utils import *
def factory(inputs, params,reuse_variables=False):
if params.task=='semantic': return SemanticNetwork(inp... | de | 0.659736 | #### ENCODERS #### #### TRANSFER #### #### DECODERS #### | 2.398142 | 2 |
examples/training/avg_word_embeddings/training_stsbenchmark_bow.py | dd-dos/sentence-transformers | 1 | 6624531 | """
This example uses a simple bag-of-words (BoW) approach. A sentence is mapped
to a sparse vector with e.g. 25,000 dimensions. Optionally, you can also use tf-idf.
To make the model trainable, we add multiple dense layers to create a Deep Averaging Network (DAN).
"""
import torch
from torch.utils.data import DataLoa... | """
This example uses a simple bag-of-words (BoW) approach. A sentence is mapped
to a sparse vector with e.g. 25,000 dimensions. Optionally, you can also use tf-idf.
To make the model trainable, we add multiple dense layers to create a Deep Averaging Network (DAN).
"""
import torch
from torch.utils.data import DataLoa... | en | 0.677895 | This example uses a simple bag-of-words (BoW) approach. A sentence is mapped to a sparse vector with e.g. 25,000 dimensions. Optionally, you can also use tf-idf. To make the model trainable, we add multiple dense layers to create a Deep Averaging Network (DAN). #### Just some code to print debug information to stdout ... | 2.937237 | 3 |
util/chplenv/chpl_llvm.py | cassella/chapel | 0 | 6624532 | <gh_stars>0
#!/usr/bin/env python3
import optparse
import os
import sys
import chpl_bin_subdir, chpl_arch, chpl_compiler, chpl_platform, overrides
from chpl_home_utils import get_chpl_third_party
from utils import memoize, error, run_command, try_run_command, warning
# returns a tuple of supported major LLVM versions... | #!/usr/bin/env python3
import optparse
import os
import sys
import chpl_bin_subdir, chpl_arch, chpl_compiler, chpl_platform, overrides
from chpl_home_utils import get_chpl_third_party
from utils import memoize, error, run_command, try_run_command, warning
# returns a tuple of supported major LLVM versions as strings
... | en | 0.823108 | #!/usr/bin/env python3 # returns a tuple of supported major LLVM versions as strings # Which major release - only need one number for that with current # llvm (since LLVM 4.0). # These will be tried in order. # put platform-arch-compiler for included llvm # just put 'system' for system llvm # returns a string of the su... | 2.130681 | 2 |
scrape_test2.py | peterhogan/python | 0 | 6624533 | from bs4 import BeautifulSoup
from urllib2 import urlopen
from time import sleep # be nice
BASE_URL = "http://www.chicagoreader.com"
def make_soup(url):
html = urlopen(url).read()
return BeautifulSoup(html, "lxml")
def get_category_links(section_url):
soup = make_soup(section_url)
boccat = soup.fi... | from bs4 import BeautifulSoup
from urllib2 import urlopen
from time import sleep # be nice
BASE_URL = "http://www.chicagoreader.com"
def make_soup(url):
html = urlopen(url).read()
return BeautifulSoup(html, "lxml")
def get_category_links(section_url):
soup = make_soup(section_url)
boccat = soup.fi... | en | 0.714382 | # be nice # a list to store our dictionaries # be nice | 3.248366 | 3 |
Microsoft/functions30-2.py | marconipoveda/Python101 | 0 | 6624534 | <reponame>marconipoveda/Python101<filename>Microsoft/functions30-2.py
def get_initial(name):
return name[0:1].upper()
fn=input('Enter your first name: ')
mn=input('Enter your middle name: ')
ln=input('Enter your last name: ')
# 0 - Before creating the function get_initial()
# fn_i = fn[0:1]
# mn_i = mn[0:1]
# ln_... | def get_initial(name):
return name[0:1].upper()
fn=input('Enter your first name: ')
mn=input('Enter your middle name: ')
ln=input('Enter your last name: ')
# 0 - Before creating the function get_initial()
# fn_i = fn[0:1]
# mn_i = mn[0:1]
# ln_i = ln[0:1]
# 1 - Before calling function inside the print statement
... | en | 0.462938 | # 0 - Before creating the function get_initial() # fn_i = fn[0:1] # mn_i = mn[0:1] # ln_i = ln[0:1] # 1 - Before calling function inside the print statement # fn_i = get_initial(fn) # mn_i = get_initial(mn) # ln_i = get_initial(ln) # 0 - Before calling function inside the print statement # 1 - print('Your initials are:... | 4.082369 | 4 |
avilla/core/service/sqlmodel.py | BlueGlassBlock/Avilla | 0 | 6624535 | <filename>avilla/core/service/sqlmodel.py
from typing import TYPE_CHECKING, Type
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
from sqlmodel import SQLModel
from avilla.core.launch import LaunchComponent
from avilla.core.service import Service
from avilla.core.service.entity import ExportInterfa... | <filename>avilla/core/service/sqlmodel.py
from typing import TYPE_CHECKING, Type
from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine
from sqlmodel import SQLModel
from avilla.core.launch import LaunchComponent
from avilla.core.service import Service
from avilla.core.service.entity import ExportInterfa... | none | 1 | 2.28615 | 2 | |
engage/adapter_pkg/datablox_engage_adapter/file_locator.py | mpi-sws-rse/datablox | 0 | 6624536 | import os
import os.path
import sys
def np(p):
"""normalize a path"""
return os.path.abspath(os.path.expanduser(p))
def check_dir(dirpath):
if not os.path.isdir(dirpath):
raise Exception("Could not find directory '%s' - is your Engage environment set up correctly?" % dirpath)
def check_file(filepath):
if... | import os
import os.path
import sys
def np(p):
"""normalize a path"""
return os.path.abspath(os.path.expanduser(p))
def check_dir(dirpath):
if not os.path.isdir(dirpath):
raise Exception("Could not find directory '%s' - is your Engage environment set up correctly?" % dirpath)
def check_file(filepath):
if... | en | 0.927274 | normalize a path This class has methods to return the locations of various files and directories used by Datablox and Engage, assuming that Datablox was deployed by Engage. # First get the deployment home by searching up the directory tree. # We need to resolve any symlinks first due to the new virtualenv structure... | 2.484545 | 2 |
runtests.py | weijia/django-dhcp | 1 | 6624537 | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="django_dhcp.urls",
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="django_dhcp.urls",
INSTALLED_APPS=[
... | en | 0.624159 | # Run tests | 1.988507 | 2 |
buildscripts/resmokelib/logging/handlers.py | MartinNeupauer/mongo | 1 | 6624538 | <filename>buildscripts/resmokelib/logging/handlers.py
"""
Additional handlers that are used as the base classes of the buildlogger
handler.
"""
from __future__ import absolute_import
import json
import logging
import sys
import threading
import warnings
import requests
import requests.auth
try:
import requests.... | <filename>buildscripts/resmokelib/logging/handlers.py
"""
Additional handlers that are used as the base classes of the buildlogger
handler.
"""
from __future__ import absolute_import
import json
import logging
import sys
import threading
import warnings
import requests
import requests.auth
try:
import requests.... | en | 0.894368 | Additional handlers that are used as the base classes of the buildlogger handler. # Versions of the requests package prior to 1.2.0 did not vendor the urllib3 package. A handler class that buffers logging records in memory. Whenever each record is added to the buffer, a check is made to see if the buffer should... | 2.2544 | 2 |
qclib/state_preparation/util/tree_utils.py | adjs/qclib | 1 | 6624539 | # Copyright 2021 qclib project.
# 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 qclib project.
# 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.820063 | # Copyright 2021 qclib project. # 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, sof... | 2.707849 | 3 |
tests/deriva/utils/catalog/manage/test_derivaCatalogToString.py | informatics-isi-edu/deriva-catalog-manage | 0 | 6624540 | from unittest import TestCase
import tempfile
import sys
import deriva.core.ermrest_model as em
from deriva.utils.catalog.manage.utils import TempErmrestCatalog, load_module_from_path
from deriva.core import get_credential
from deriva.core import tag as chaise_tags
from deriva.utils.catalog.manage.dump_catalog import D... | from unittest import TestCase
import tempfile
import sys
import deriva.core.ermrest_model as em
from deriva.utils.catalog.manage.utils import TempErmrestCatalog, load_module_from_path
from deriva.core import get_credential
from deriva.core import tag as chaise_tags
from deriva.utils.catalog.manage.dump_catalog import D... | vi | 0.058601 | # m.main(test_catalog, 'columns', replace=True, really=True) | 2.273252 | 2 |
selfdrive/car/gm/interface.py | solardude2/openpilot | 0 | 6624541 | #!/usr/bin/env python3
from cereal import car
from math import fabs
from common.conversions import Conversions as CV
from common.params import Params
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config
from selfdrive.car.gm.values import CAR, Cruise... | #!/usr/bin/env python3
from cereal import car
from math import fabs
from common.conversions import Conversions as CV
from common.params import Params
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config
from selfdrive.car.gm.values import CAR, Cruise... | en | 0.856552 | #!/usr/bin/env python3 # Determined by iteratively plotting and minimizing error for f(angle, speed) = steer. #46341000035928637 #8317776927522815 #31396926577596984 #32536345911579184 #8390269362439537 #-2.656819831714162 # UNSAFE_DISABLE_DISENGAGE_ON_GAS # TODO: JJS this value should come from the toggle # stock crui... | 2.241663 | 2 |
Practica07/EllipticCurvesTests.py | Argenis616/cryptography | 0 | 6624542 | import EllipticCurves as ec
c = ec.Curve(2, 3, 97)
def test_class():
assert c.is_on_curve((17, 10))
assert c.is_on_curve((95, 31))
assert not c.is_on_curve((13, 13))
assert c.is_on_curve(None)
assert c.determinant() == 275
P, Q = (17, 10), (95, 31)
def test_add_curve():
p_plus_q = ec.add... | import EllipticCurves as ec
c = ec.Curve(2, 3, 97)
def test_class():
assert c.is_on_curve((17, 10))
assert c.is_on_curve((95, 31))
assert not c.is_on_curve((13, 13))
assert c.is_on_curve(None)
assert c.determinant() == 275
P, Q = (17, 10), (95, 31)
def test_add_curve():
p_plus_q = ec.add... | none | 1 | 2.96779 | 3 | |
Saves_display.py | Vovadoes/Yandex-Race | 1 | 6624543 | <filename>Saves_display.py
import os
import datetime
import pygame
from Car import Car
from Image import Image
from Road import Text
from Save import Save
from Starter import Starter
def saves_dislpay(screen, size):
from Menu import menu
from Button import Button
background_sprites = pygame.sprite.Grou... | <filename>Saves_display.py
import os
import datetime
import pygame
from Car import Car
from Image import Image
from Road import Text
from Save import Save
from Starter import Starter
def saves_dislpay(screen, size):
from Menu import menu
from Button import Button
background_sprites = pygame.sprite.Grou... | ru | 0.800362 | # CONST # создадим спрайт # определим его вид # и размеры # print("button_left") # print("button_right") | 3.361243 | 3 |
python/twisted_client_server/calculus/base.py | tardate/LittleCodingKata | 8 | 6624544 | """Calculation class.
An uber-simple implementation of some pure-python "business logic"
"""
class Calculation(object):
def _make_ints(self, *args):
try:
return map(int, args)
except ValueError:
raise TypeError("Couldn't coerce arguments to integers: %s" % args)
def a... | """Calculation class.
An uber-simple implementation of some pure-python "business logic"
"""
class Calculation(object):
def _make_ints(self, *args):
try:
return map(int, args)
except ValueError:
raise TypeError("Couldn't coerce arguments to integers: %s" % args)
def a... | en | 0.806254 | Calculation class. An uber-simple implementation of some pure-python "business logic" | 3.454022 | 3 |
pywinautofiles/examples/ForteAgentSample.py | jingring/pywinautolib | 0 | 6624545 | <filename>pywinautofiles/examples/ForteAgentSample.py<gh_stars>0
"""Perform some tests with Forte Agent
NOTE: Forte Agent has a very dynamic interface
e.g. whether it is free or not, whether it is still in the grace
period. For this reason this example script may or may not work well
for you"""
print __doc__
import ... | <filename>pywinautofiles/examples/ForteAgentSample.py<gh_stars>0
"""Perform some tests with Forte Agent
NOTE: Forte Agent has a very dynamic interface
e.g. whether it is free or not, whether it is still in the grace
period. For this reason this example script may or may not work well
for you"""
print __doc__
import ... | en | 0.733891 | Perform some tests with Forte Agent NOTE: Forte Agent has a very dynamic interface e.g. whether it is free or not, whether it is still in the grace period. For this reason this example script may or may not work well for you # start the application and wait for the Agent Dialog to be ready # if the trial nag dialog po... | 2.402647 | 2 |
django_qingstor_storage/__init__.py | knktc/django-qingstor-storage | 2 | 6624546 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author:knktc
@contact:<EMAIL>
@create:2018-08-31 15:40
"""
__author__ = 'knktc'
__version__ = '0.1'
def main():
"""
main process
"""
if __name__ == '__main__':
main()
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author:knktc
@contact:<EMAIL>
@create:2018-08-31 15:40
"""
__author__ = 'knktc'
__version__ = '0.1'
def main():
"""
main process
"""
if __name__ == '__main__':
main()
| en | 0.349228 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- @author:knktc @contact:<EMAIL> @create:2018-08-31 15:40 main process | 1.279036 | 1 |
level25.py | CoffeeTableEnnui/RedCircleGame | 0 | 6624547 | <filename>level25.py
import rectangles as r
import circles as c
import games as g
import pygame
level = g.Game(100, 700, 100, 100)
level.addwall(50, 600, 390, 410)
level.addwall(160, 180, 50, 189)
level.addwall(390, 410, 690, 710)
enemy0 = c.SmallEnemy(79, 200)
enemy0.xdir = -1
enemy0.start, enemy0.end = 79, 727
leve... | <filename>level25.py
import rectangles as r
import circles as c
import games as g
import pygame
level = g.Game(100, 700, 100, 100)
level.addwall(50, 600, 390, 410)
level.addwall(160, 180, 50, 189)
level.addwall(390, 410, 690, 710)
enemy0 = c.SmallEnemy(79, 200)
enemy0.xdir = -1
enemy0.start, enemy0.end = 79, 727
leve... | none | 1 | 3.021845 | 3 | |
src/Group the People give the Size/solution.py | sankalok/leetcode-questions | 0 | 6624548 | <reponame>sankalok/leetcode-questions<gh_stars>0
class Solution:
def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]:
groups = []
counter = 1
counterMax = max(groupSizes)
while(counter <= counterMax):
indexes = []
for i in range(0, len(... | class Solution:
def groupThePeople(self, groupSizes: List[int]) -> List[List[int]]:
groups = []
counter = 1
counterMax = max(groupSizes)
while(counter <= counterMax):
indexes = []
for i in range(0, len(groupSizes)):
if(groupSizes[i] ==... | none | 1 | 3.282323 | 3 | |
sark/codeblock.py | yannayl/Sark | 1 | 6624549 | <reponame>yannayl/Sark
import networkx
import idaapi
from .code import lines, functions
from .core import get_func, fix_addresses
class CodeBlock(idaapi.BasicBlock):
def __init__(self, id_ea=None, bb=None, fc=None):
if bb is None and fc is None:
if id_ea is None:
id_ea = idaap... | import networkx
import idaapi
from .code import lines, functions
from .core import get_func, fix_addresses
class CodeBlock(idaapi.BasicBlock):
def __init__(self, id_ea=None, bb=None, fc=None):
if bb is None and fc is None:
if id_ea is None:
id_ea = idaapi.get_screen_ea()
... | en | 0.781006 | Get the start address of an IDA Graph block. Convert an IDA flowchart to a NetworkX graph. # Make sure all nodes are added (including edge-less nodes) Get all `CodeBlock`s in a given range. Args: start - start address of the range. If `None` uses IDB start. end - end address of the range. If `None`... | 2.435236 | 2 |
src/notification.py | maknotavailable/security-hub | 2 | 6624550 | <reponame>maknotavailable/security-hub
import boto3 as b3
from botocore.exceptions import ClientError
import logging
# Custom functions
import utils
# Format logging
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO,
format = '%(asctime)s - %(levelname)s - %(name)s -... | import boto3 as b3
from botocore.exceptions import ClientError
import logging
# Custom functions
import utils
# Format logging
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO,
format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s')
class Email():
de... | en | 0.703457 | # Custom functions # Format logging Authenticate email server and prepare configuration # AWS access # Create a new SES resource and specify a region. # Sender, receiver # Config Append payload and send email # Try to send the email. #Provide the contents of the email. | 2.34953 | 2 |