prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
pending.append(_('\nPending posts:')) first = False
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
upending.append(s)
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
upending.append(unicode(s, charset, 'replace'))
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
return text.encode(outcodec, 'replace')
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
for request in heldmsgs: key, data = requestsdb.get_request(request.id) if now - data['date'] > expire: handle_request(mlist, request.id, config.DISCARD) discard_count += 1 mlist.Save()
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
handle_request(mlist, request.id, config.DISCARD) discard_count += 1
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
date = time.localtime()[:3]
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
evictions.append(sender)
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
for sender in evictions: del mlist.hold_and_cmd_autoresponses[sender] # This is the only place we've changed the list's database mlist.Save()
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
_.default = mlist.preferred_language realname = mlist.real_name discarded = auto_discard(mlist) if discarded: count = count - discarded text = _('Notice: $discarded old request(s) ' 'auto...
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
count = count - discarded text = _('Notice: $discarded old request(s) ' 'automatically expired.\n\n')
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
text = ''
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
text += Utils.maketext( 'checkdbs.txt', {'count' : count, 'mail_host': mlist.mail_host, 'adminDB' : mlist.GetScriptURL('admindb', absolute=1)...
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
subject = _('$realname moderator request check result')
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
main()
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
parseargs
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
pending_requests
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
auto_discard
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
midnight
<|file_name|>checkdbs.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 F...
main
<|file_name|>makerealworddoc.py<|end_file_name|><|fim▁begin|>#coding=gbk """Convert HTML page to Word 97 document This script is used during the build process of "Dive Into Python" (http://diveintopython.org/) to create the downloadable Word 97 version of the book (http://diveintopython.org/diveintopython.doc) Looks ...
<|file_name|>makerealworddoc.py<|end_file_name|><|fim▁begin|>#coding=gbk """Convert HTML page to Word 97 document This script is used during the build process of "Dive Into Python" (http://diveintopython.org/) to create the downloadable Word 97 version of the book (http://diveintopython.org/diveintopython.doc) Looks ...
word = gencache.EnsureDispatch("Word.Application") try: worddoc = word.Documents.Open(FileName=infile) try: worddoc.TablesOfContents.Add(Range=word.ActiveWindow.Selection.Range, \ RightAlignPageNumbers=1, \ UseHeadingStyles=1, \ UpperHeadingLevel=1, \ LowerHeadingLev...
<|file_name|>makerealworddoc.py<|end_file_name|><|fim▁begin|>#coding=gbk """Convert HTML page to Word 97 document This script is used during the build process of "Dive Into Python" (http://diveintopython.org/) to create the downloadable Word 97 version of the book (http://diveintopython.org/diveintopython.doc) Looks ...
le = os.path.normpath(os.path.join(os.getcwd(), sys.argv[1])) outfile = os.path.normpath(os.path.join(os.getcwd(), sys.argv[2])) makeRealWordDoc(infile, outfile)
<|file_name|>makerealworddoc.py<|end_file_name|><|fim▁begin|>#coding=gbk """Convert HTML page to Word 97 document This script is used during the build process of "Dive Into Python" (http://diveintopython.org/) to create the downloadable Word 97 version of the book (http://diveintopython.org/diveintopython.doc) Looks ...
makeRealWordDoc
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- <|fim▁hole|> from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm" file_output = open(name_file, 'a') email_current_session...
from scrapy.spider import Spider from scrapy.selector import Selector
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
name = 'newenglandfilm' allowed_domains = ["newenglandfilm.com"] start_urls = ["http://newenglandfilm.com/jobs.htm"] def parse(self, response): sel = Selector(response) for num_div in xrange(1, 31): date = sel.xpath('//*[@id="mainContent"]/div[{0}]/span/text()'.format...
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
sel = Selector(response) for num_div in xrange(1, 31): date = sel.xpath('//*[@id="mainContent"]/div[{0}]/span/text()'.format(str(num_div))).re('(\d{1,2}\/\d{1,2}\/\d{4})')[0] email = sel.xpath('//*[@id="mainContent"]/div[{0}]/div/text()'.format(str(num_div))).re('(\w+@[a-zA-Z0...
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
current_date = (datetime.today() - timedelta(days=difference_days)).strftime('%m/%d/%Y')
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
current_date = datetime.today().strftime('%m/%d/%Y')
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
for address in email: if address + "\n" not in email_in_file and address not in email_current_session: file_output.write(address + "\n") email_current_session.append(address) print "Spider: NewenglandFilm. Em...
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
file_output.write(address + "\n") email_current_session.append(address) print "Spider: NewenglandFilm. Email {0} added to file".format(address)
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
print "Spider: NewenglandFilm. Email {0} already in the file".format(address)
<|file_name|>newenglandfilm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from scrapy.spider import Spider from scrapy.selector import Selector from my_settings import name_file, test_mode, difference_days from datetime import datetime, timedelta print "Run spider NewenglandFilm"...
parse
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime<|fim▁hole|>import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True). """ retu...
from decimal import Decimal
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): <|fim_middle|> def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'): """ Similar to smart_text, except that lazy instances are res...
"""Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True). """ return isinstance(obj, ( six.integer_types + (types.NoneType, datetime.datetime, datetime.date, datetime.time, ...
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
""" Similar to smart_text, except that lazy instances are resolved to strings, rather than kept as lazy objects. If strings_only is True, don't convert (some) non-string-like objects. """ # Handle the common case first, saves 30-40% when s is an instance of # six.text_type. This function ge...
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
return s
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
return s
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
if hasattr(s, '__unicode__'): s = s.__unicode__() else: if six.PY3: if isinstance(s, bytes): s = six.text_type(s, encoding, errors) else: s = six.text_type(s) e...
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
s = s.__unicode__()
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
if six.PY3: if isinstance(s, bytes): s = six.text_type(s, encoding, errors) else: s = six.text_type(s) else: s = six.text_type(bytes(s), encoding, errors)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
if isinstance(s, bytes): s = six.text_type(s, encoding, errors) else: s = six.text_type(s)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
s = six.text_type(s, encoding, errors)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
s = six.text_type(s)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
s = six.text_type(bytes(s), encoding, errors)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
s = s.decode(encoding, errors)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
raise UnicodeDecodeError(*e.args)
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
s = ' '.join([force_unicode(arg, encoding, strings_only, errors) for arg in s])
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def <|fim_middle|>(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True). ...
is_protected_type
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import datetime from decimal import Decimal import types import six def is_protected_type(obj): """Determine if the object instance is of a protected type. Objects of protected types are preserved as-is when passed to force_unicode(strings_only=True)....
force_unicode
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
# and save in originOfLife folder for further parsing.
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
osmName = sys.argv[1]
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
optionAllowLoop = (sys.argv[2] == '1')
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
osmNameWoExt = osmName
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
osmNameWoExt = osmName[:-(1+len(osmName.split('.')[-1]))]
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
print('File existed. Skip.')
<|file_name|>script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import re # file name unified by the following rule: # 1. always save the osm under ../osmFiles directory # 2. the result automatically generate to ../trajectorySets # 3.1. change variable "osmName", or # 3.2. use command argum...
os.system(cmd)
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): <|fim_middle|> c...
""" """ ns = {'pcbmode':config.cfg['ns']['pcbmode'], 'svg':config.cfg['ns']['svg']} # Open the board's SVG svg_in = utils.openBoardSVG() drills_layer = svg_in.find("//svg:g[@pcbmode:sheet='drills']", namespaces=ns) excellon = Excellon(drills_layer...
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" """ def __init__(self, svg): """ """ self._svg = svg self._ns = {'pcbmode':config.cfg['ns']['pcbmode'], 'svg':config.cfg['ns']['svg']} # Get all drill paths except for the ones used in the # drill-index drill_paths = self._...
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" """ self._svg = svg self._ns = {'pcbmode':config.cfg['ns']['pcbmode'], 'svg':config.cfg['ns']['svg']} # Get all drill paths except for the ones used in the # drill-index drill_paths = self._svg.findall(".//svg:g[@pcbmode:type='component...
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
return (self._preamble+ self._content+ self._postamble)
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" """ ex = [] for i, diameter in enumerate(drills): # This is probably not necessary, but I'm not 100% certain # that if the item order of a dict is gurenteed. If not # the result can be quite devastating where drill # diameters are wrong...
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" """ ex = [] ex.append('M48\n') # Beginning of a part program header ex.append('METRIC,TZ\n') # Metric, trailing zeros ex.append('G90\n') # Absolute mode ex.append('M71\n') # Metric measuring mode return ex
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" """ ex = [] ex.append('M30\n') # End of Program, rewind return ex
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" Returns the location of a path, factoring in all the transforms of its ancestors, and its own transform """ location = Point() # We need to get the transforms of all ancestors that have # one in order to get the location correctly ancestors = path.xp...
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
""" Converts a Point type into an Excellon coordinate """ return "X%.6fY%.6f\n" % (point.x, -point.y)
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
drills_dict[diameter] = {} drills_dict[diameter]['locations'] = []
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
transform_data = utils.parseTransform(transform) location += transform_data['location']
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def <|fim_middle|>(manufacturer='default'): """ """ ns ...
makeExcellon
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
__init__
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
getExcellon
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
_createContent
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
_createPreamble
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
_createPostamble
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
_getLocation
<|file_name|>excellon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import re from lxml import etree as et import pcbmode.config as config from . import messages as msg # pcbmode modules from . import utils from .point import Point def makeExcellon(manufacturer='default'): """ """ ns = ...
_getPoint
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== <|fim▁hole|> ...
class FarmworkForm(forms.ModelForm): def __init__(self, *args, **kwargs):
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
def __init__(self, *args, **kwargs): super(FarmworkForm, self).__init__(*args, **kwargs) class Meta: model = Farmwork fields = [ 'job_role', 'job_fruit', 'job_pay', 'job_pay_type', 'job_start_date', 'job_duration', ...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
super(FarmworkForm, self).__init__(*args, **kwargs)
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
model = Farmwork fields = [ 'job_role', 'job_fruit', 'job_pay', 'job_pay_type', 'job_start_date', 'job_duration', 'job_duration_type', 'job_description', 'con_first_name', 'con_surname...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
if self.instance.pk: return super(FarmworkForm, self).save() instance = super(FarmworkForm, self).save(commit=False) instance.slug = slugify(instance.get_job_fruit_display() + '-' + instance.get_job_role_display() + '-in-' + instance.loc_city) instance.save() return...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
return super(FarmworkForm, self).save()
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
__init__
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># # farmwork/forms.py # from django import forms from django.utils.text import slugify from .models import Farmwork # ======================================================== # FARMWORK FORM # ======================================================== class FarmworkF...
save
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from .workflow import TestStateMachine class TestModel(models.Model): name = models.CharField(max_length=100) state = models.CharField(max_length=20, null=True, blank=True) state_num = models.IntegerField(null=True, blank=Tr...
message = models.CharField(max_length=250, null=True, blank=True) class Meta: permissions = TestStateMachine.get_permissions('testmodel', 'Test')
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from .workflow import TestStateMachine class TestModel(models.Model): <|fim_middle|> <|fim▁end|>
name = models.CharField(max_length=100) state = models.CharField(max_length=20, null=True, blank=True) state_num = models.IntegerField(null=True, blank=True) other_state = models.CharField(max_length=20, null=True, blank=True) message = models.CharField(max_length=250, null=True, blank=True) cl...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from .workflow import TestStateMachine class TestModel(models.Model): name = models.CharField(max_length=100) state = models.CharField(max_length=20, null=True, blank=True) state_num = models.IntegerField(null=True, blank=Tr...
permissions = TestStateMachine.get_permissions('testmodel', 'Test')
<|file_name|>multiprocess.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 from multiprocessing import Process, Pool import os, time def proc(name): <|fim▁hole|> print(time.asctime(), 'child process(name: %s) id %s. ppid %s' % (name, os.getpid(), os.getppid())) time.sleep(3) print(time.asctime...
<|file_name|>multiprocess.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 from multiprocessing import Process, Pool import os, time def proc(name): <|fim_middle|> if __name__ == '__main__': p = Process(target = proc, args = ('child',)) print(time.asctime(), 'child process will sta...
print(time.asctime(), 'child process(name: %s) id %s. ppid %s' % (name, os.getpid(), os.getppid())) time.sleep(3) print(time.asctime(), 'child process end')
<|file_name|>multiprocess.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 from multiprocessing import Process, Pool import os, time def proc(name): print(time.asctime(), 'child process(name: %s) id %s. ppid %s' % (name, os.getpid(), os.getppid())) time.sleep(3) print(time.asctime(), 'child ...
p = Process(target = proc, args = ('child',)) print(time.asctime(), 'child process will start') p.start() p.join() print('first child process end') pl = Pool(4) for index in range(4): pl.apply_async(proc, args = (index,)) pl.close() pl.join() print(time.a...
<|file_name|>multiprocess.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 from multiprocessing import Process, Pool import os, time def <|fim_middle|>(name): print(time.asctime(), 'child process(name: %s) id %s. ppid %s' % (name, os.getpid(), os.getppid())) time.sleep(3) print(time.asctime(...
proc
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = (<|fim▁hole|>) ENGINE = os.environ.get('DATABASE_EN...
('Justin Quick', 'justquick@gmail.com'),
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) EN...
USER, PASSWORD = 'test', 'test' if os.environ.get('TRAVIS', False): if 'mysql' in ENGINE: USER, PASSWORD = 'travis', '' else: USER, PASSWORD = 'postgres', '' DATABASES['default'].update( USER=os.environ.get('DATABASE_USER', USER), PASSWORD=os.environ.g...
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) EN...
if 'mysql' in ENGINE: USER, PASSWORD = 'travis', '' else: USER, PASSWORD = 'postgres', ''
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) EN...
USER, PASSWORD = 'travis', ''
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) EN...
USER, PASSWORD = 'postgres', ''
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) EN...
AUTH_USER_MODEL = 'testapp.MyUser'
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for example_project project. import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import django DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Justin Quick', 'justquick@gmail.com'), ) EN...
INSTALLED_APPS += ('django_coverage',) TEST_RUNNER = 'django_coverage.coverage_runner.CoverageRunner' COVERAGE_REPORT_HTML_OUTPUT_DIR = 'coverage' COVERAGE_REPORT_DATA_FILE = '.coverage'
<|file_name|>ext.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from datetime import timedelta, datetime import asyncio import random from .api import every, once_at, JobSchedule, default_schedule_manager __all__ = ['every_day', 'every_week', 'every_monday', 'every_tuesday', 'every_wednesday', 'eve...
with a different event loop.